NodeBB
NodeBB copied to clipboard
Banned User not being removed from Groups
When a user is banned they are only removed from system groups (except Banned Users group) but aren't removed from custom created groups. Is this intentional behaviour?
If so, is it possible to add options in Admin to select whether to remove from all groups or to have a list of groups to remove from on ban?
Currently I'm using the ban action hook to remove from custom groups but it doesnt allow the Community Managers to manage that list if and when they add a new group.
Hmm... without knowing the full context, I would guess that this was intentional insomuch that we don't know what groups to re-add the user to upon unban or ban expiry.
There are two approaches here—either we remove the user from all non-system groups (toggleable via feature flag), or we update the getMembers
(and other variants) method to filter out banned users.
Directly checking group:${groupName}:members
would return banned uids, as is normal.
Sorry for the slow reply, this must have got lost in my emails when I was away.
Prior to the change to put banned users in a group (instead of preventing them from being logged in), banned users were treated as guests. Assuming that is true of all setups and not just my version?
Makes sense to me that when banned they should be placed in the banned group and removed from all groups (like a guest would have been treated as previously). Then privileges for the banned group could be tailored for any extra/reduced access they have than standard guest privileges.
Not sure of the pros and cons of updating getMembers
approach as I don't know what other workflows it might affect in the forum.
That approach might work, it's worth investigating
Circling back, I think we may be able to do both, in the sense that banned users can be added to a "Banned Users" group, and they can also be removed from the group members' list on-the-fly.
Then we would be able to keep their group memberships upon unban.