I have an unusual requirement where I need to mount the same filesystem on a client multiple times, but each mount offering a different view of the underlying data, based on the group permissions of the underlying directories and files.
I have achieved this in the past with NFS and the all_squash and anongid /etc/exports option, making a specific mount appear as though the user had a specific group ID. It effectively filtered access to the underlying filesystem by forcing the accessing user's group.
Unfortunately I can't use that in this scenario, as the filesystem will be Amazon EFS (effectively an NFS server, but without any configuration options).
I have looked at bindfs, and this provides a force-group option, but this is the reverse of what I want, since it forces all files to have a specific group, rather than forcing the client to have a specific group, looking at the files unchanged.
I did see a mention of something called filterfs, but it appears to be long dead.
Does anybody know a way to get a filtered view of a file system for a single user by effectively changing the user's group on an ad-hoc basis (without using sudo, since the user is a webserver daemon).
bindfs --map=@files-group:@webserver-daemon-group?webserver-daemon-groupto access files as if they were a member of the groupfiles-group. This seems similar, but not identical, to all_squash with anongid=files-group. I don't know if that meets your needs and I don't have a list handy of the cases where behaviour would be different. The files-group could be varied for different mounts for a similar effect to varying anongid. (And if you want you could vary webserver-daemon-group to restrict access, without needing to vary access permissions on a parent directory.)