moderated Banning misbehavior and error message enhancement #bug #suggestion


 

Hi Mark,

When a group has subgroups, banning a member on the main group can create a problem due to the lack of checking for that member's sole ownership in a subgroup, unlike when deleting that member where that check does take place.

We discovered it in this GMF thread.  The owner had created some time ago a test subgroup with the old account and it was the sole member of that subgroup and apparently forgot about it.  Then at some point in time they created a separate new owner account, and demoted that old account in the main group, but forgot to also do it in the subgroup.  They went then to remove that old account but accidentally clicked on Ban instead.

If they had clicked Delete they would have gotten the "The member cannot be removed because they are the sole owner of the group" error message and the delete wouldn't take place, because that old account is the sole owner of a subgroup.

Banning though doesn't check that so it goes ahead and bans the member in the main group and dutifully also bans them in that subgroup they are the sole member and sole owner.  So when the owner went back to unban his mistakenly-banned old account (which will now remove them from the main and subgroups) they now get the same red "The member cannot be removed because they are the sole owner of the group" error message and the user stays banned.  The eventual workaround was to add another owner in that subgroup and then that old address could be then successfully unbanned.  (Or just delete that old test subgroup, either way)

If banning someone in the main group also performed the same subgroup sole ownership check as deleting them, then this can be avoided as the ban wouldn't take place unless another owner was added beforehand, the same process one has to do if deleting that same person in the same scenario.


Also a related suggestion while at it, the "The member cannot be removed because they are the sole owner of the group" error message is a bit misleading for groups with subgroups as it implies the currently-viewed group ownership (usually the main group) but in this case it's really a subgroup ownership, so the message could stand to be tweaked a bit, just changing "...sole owner of the group" to "...sole owner of the main group or a subgroup" would cover all bases.  The owner in the above case was checking the main group ownership only based on what he was seeing in the message, which had two owners yet the error message was stating that old address was the sole owner of the group.  If the error message had included "or subgroup" then most likely the owner would have figured out that there was a (forgotten) subgroup involved somehow, that's how I figured it out eventually anyway, noticing his group had subgroups by seeing that in the screenshots.

Cheers,
Christos


 

On Tue, Jul 5, 2022 at 4:03 PM Christos Psarras <christos@...> wrote:
Hi Mark,

When a group has subgroups, banning a member on the main group can create a problem due to the lack of checking for that member's sole ownership in a subgroup, unlike when deleting that member where that check does take place.

I've fixed it so that you can no longer ban a member of the main group if that person is the sole owner of a subgroup.

Also, I've fixed the error message so that when attempting to remove a member of a main group that is the sole owner of a subgroup, it says as such.

Thanks,
Mark