Limiting the number of users in a group

I would like to be able to have a group for my app and limit the number of users that can be in that group to 10 or 100 (depending upon a setting) so that someone can go into the Users page and assign this group to users up to the value then no more users can be assigned that group. I was looking at using hooks to achieve this and hooking into the event when a user is added to a group and removing the user from the group if it is over the limit. Is this the correct approach or is there a better way?

1 Like

Hi,

I am currently working on an app that will allow non-admin to generate their own groups (to help sharing files for example): https://github.com/nextcloud/circles (work in progress, you will need to patch your nextcloud)
This app will include an API to generate/manage groups, but might be a small feature to add the possibility to set a limit to the group size

Thanks, I will have a look at it.