On ubuntu I have the following:
A folder: `shares`, pemissions 755, owner root:somegroup.
user1 user2 (groupx)
user3 user4 (groupy)
According to this topic this is not possible.
To create/remove files in some dir you need to have a wx permissions to its parent dir. The user can even delete a file that he is not able to read.
The only option I see is to create the subdirectories for each user, where only this user has write permission. (chmod 750)
It's possible! I was not aware of the sticky bit:
chmod 1770 on parent dir.
This adds a requirement that only dir owner or file owner can delete a file inside.