2018-04-25, 03:48 AM
A user can be leader of a group he / she doesn't even belong to.
If this scenario seems little impractical; possible solution might be:
Throw an error during assignment in ACP if the user doesn't have the subject group id in his / her user / additional user group.
or
Silently accept the assignment and add the subject group to user's additional usergroup.
I'd possibly go for throwing an error; even better not to show the user to the leader selection dropdown if he / she doesn't belong to that group.
Ideas?
Edit: Further research:
A user can be moderator of a forum he / she can't even see.
Reproduction steps:
Case 01:
Set a forum (say, "MyForum") as members under "Registered" group can't see. Make a user under "Registered" group. Now assign the member to the moderator of the forum "MyForum". The member will be automatically upgraded to "Moderator" group (a question here, why primary? why not additional? But thats okay).
Now demote the member to "Registered" group. The member can't see the forum anymore but still assigned as Moderator of it.
Case 02:
Set a forum (say, "MyForum"). Make a user under "Registered" group. Assign the member to be Moderator of that group. Make sure he is still under "Registered" group. If not - put him back to registered group. Everything fine so far, he can still moderate that forum. Now:
Set the forum permission as "Registered" group can't see! Wow. he is still moderator and he can't see the forum!
If this scenario seems little impractical; possible solution might be:
Throw an error during assignment in ACP if the user doesn't have the subject group id in his / her user / additional user group.
or
Silently accept the assignment and add the subject group to user's additional usergroup.
I'd possibly go for throwing an error; even better not to show the user to the leader selection dropdown if he / she doesn't belong to that group.
Ideas?
Edit: Further research:
A user can be moderator of a forum he / she can't even see.
Reproduction steps:
Case 01:
Set a forum (say, "MyForum") as members under "Registered" group can't see. Make a user under "Registered" group. Now assign the member to the moderator of the forum "MyForum". The member will be automatically upgraded to "Moderator" group (a question here, why primary? why not additional? But thats okay).
Now demote the member to "Registered" group. The member can't see the forum anymore but still assigned as Moderator of it.
Case 02:
Set a forum (say, "MyForum"). Make a user under "Registered" group. Assign the member to be Moderator of that group. Make sure he is still under "Registered" group. If not - put him back to registered group. Everything fine so far, he can still moderate that forum. Now:
Set the forum permission as "Registered" group can't see! Wow. he is still moderator and he can't see the forum!