Let's suppose we have 2 groups: sales and account with 2 directories owned by respective users:
$ ls -l /data
total 0
drwxrwx---. 2 root account 6 Oct 12 19:30 account
drwxrwx---. 2 root sales 6 Oct 12 19:30 sales
To make group sales to access account directory:
$ setfacl -m d:g:sales:rx /data/account # this is setting the default permissions for new for files in the directory
$ setfacl -m g:sales:rx /data/account # this one is for current directory files
To make group account to access sales directory
$ setfacl -m d:g:account:rx /data/sales
$ setfacl -m g:account:rx /data/sales
Get details about the directories:
$ getfacl /data/sales
$ getfacl /data/account