edit a user without "view hidden group bages" permission can break membership of the user
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
[discuss ref](https://discuss.flarum.org/d/26218-group-membership-unstable-behavior/5)
## Bug Report
**Current Behavior**
When a user has the `edit users` permission but doesn't have the `view hidden group badges` one, he can involuntary kick off users from group with a hidden badge simply by add them or remove them to/from an other group.
**Steps to Reproduce**
1. make 3 groups and 2 users
group A has the `Edit user groups` permission but doesn't have the `View hidden group badges` one
group B has the `Hide on forum` attribute
group C is a control group without special attribute nor permission
2. add `@user1` to group A (can edit user groups) and `@user2` to group B (hidden badge)
3. with `@user1`, edit `@user2` and add him to group C.
4. `@user2` is kicked off the group B
**Expected Behavior**
`@user2` should remains into group B.
**Environment**
nightly
Contributor guide
Research direction
Start by reproducing the issue with groups A, B, and C, using the listed permissions and the hidden-badge setting. Confirm that adding the user to group C removes membership in hidden group B; done means the existing hidden-group membership remains intact.
Written by the indexing model from the issue text.
Assessment
- Domain
- authorization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100