I want to have ability to give users a directory access for a limited time. I planned to do it through group folders. I will assign users to groups and give those groups access to directories. But I’m wondering if there is a way to remove group membership after a deadline. If not how else I can achieve this functionality?
Thanks for your time.
Yes you can do that. You could use a group folder or just a regular folder for this.
Find the folder, click the share icon and search for the group you want to give temporary access to:
Then click the menu button next to the group name and click “Set expiration date” and pick the date:
Hi @joshmorel ,
Thank you for your reply. I didn’t know this feature. It may be useful for me but there is one problem. If I share a directory with someone or some group a clone of the directory is created for every user right? It’s not what I want. Because I will share read-only directories with users. So group membership with deadline may be a better alternative for me. Do you have any idea about that?
The sharing feature, it doesn’t clone anything but simply creates a database entry enabling access to what is shared. After the expiry date, it won’t show up anymore for whom it was shared with. You can also control if those shared with are allowed to create/edit/delete/reshare (if you disable them at it would “read only”).
Group membership with a deadline is not possible as a Nextcloud admin. You could technically achieve this with a shell script calling the
occ commands to remove membership but that’s probably not worth it. Also you could request the feature (via GitHub) BUT I think this sharing should work for you. If you still don’t think so, please describe your use case in more detail (what exactly are you hoping to achieve and why) so myself or someone else may be able to provide more suggestions.
When I see all shared users can rename and edit files I thought the files are recreated for each user. So in my case there will be one file of 100 MB let’s say, if it’s shared with 100 users then server will need 10000 MB of space, I assumed. If I’m wrong please correct me. If there is no cloning this may be useful for me.
I will also need a list of users who has access to a directory with deadlines. I guess I will need to write a NextCloud app for that right?
There is just one current file for everyone it is shared with.
Like other files there is versioning when edits are made which (I think) follows the same set-up to avoid overuse of storage.
So I think you are good to go with this approach. Now that doesn’t mean you shouldn’t consider open an issue in the groupfolders repo about adding expiration as an per-group option within the groupfolders app (at ? in img below). It might be more user friendly to do it all in one place:
List of users with access? I don’t see any nice way to see this either via the web UI or occ command. You can run SQL script
mysql -uroot -e 'select share_with, file_target, expiration from oc_share;' nextcloud to begin with, develop/request a feature enhancement (occ command for
Thank you very much for detailed explanation @joshmorel. I will prepare the user flow in more detailed way and decide which way to go.