Do not allow users to leave from certain group
I'm using several groups that gradually guarantee more and more privileges. Each group is reached after a certain number of posts.
They are groups in which you are automatically added or removed by the system, you cannot choose to accept or reject.
The problem is that at the moment there is no way to prevent a user from leave a group.
I wanted to use the hook
and then re-add the user after its call, but this solution could create a circularity that I don't like.
example: If an admin wants to delete a user from the group, he could not do it, because this hook does not provide information on who was doing the action, then it continues to re-add a user despite any privilege.
I think there is to use the same solution used for registrations, under the check mark
"disable join request" can be good to have "disable leave request"