user1 creates the dir, it will be owned by
user1:user1. This means user:group. Assuming they are in the same group, let's call it
user1 needs to make the group
group1 the group owner of this directory. So:
chown :group1 dir`
Now for the
manager to be able to r/w directories, the group permission bits need to be set to 7, ie
rwx. This is done so:
chmod g+rwx dir
manager creates a file it is owned by
manager:manager, so he needs to
chown it to
:group1 for the group permissions to apply to
group1, the same way
user1 had to do.
There's a trick that copies the group ownership from the parent dir. It's the special group permission bit, SGID. This can be done so:
chmod g+s dir
Finally, newly created items (files and directories) take on the permissions from their parents, plus there's a last modifier called
umask. It inverts single bits of permissions if they are set, and has the same format of 4 octal digits. Usually it is 0002 or 0022. 0002 means the second bit from the right will be masked (or inverted). For example, with
umask 0022, when you create a new dir in another dir with permissions rwxrwxrwx, the new dir will get permissions rwxr-xr-x.
umask 0022, he will also have to
chmod his dirs and files to 7 to give the group full access to them.