[Bug]: Group memberships are missing when a sub-admin edits a user
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
A sub-admin editing a user who belongs to a group they administer cannot remove the user from that group because the user's current group memberships are not displayed in the edit dialog.
But user admin can see the user's group memberships and manage them as expected.
This appears to have been introduced by #59406.
Steps to reproduce
- Log in as
admin. - Create two groups (e.g.
grp1andgrp2). - Create a user (e.g.
demo) and add the user (demo) as both a member and admin of the two groups. - Log in as
demo. - Create another user (e.g.
user1) and add them as a member of the both groups. - Open the edit dialog for
user1. - Check the member of the following groups section.
Expected behavior
The user's current group memberships are displayed, and the sub-admin can remove the user from groups they manage (also related to https://github.com/nextcloud/server/issues/61013).
Nextcloud Server version
34
Operating system
Debian/Ubuntu
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue through the user-management edit dialog with a sub-admin, then trace the code handling the dialog's group-membership data and compare it with the admin path. Review the related issues #59406 and #61013. Done means managed groups are shown for the sub-admin and can be removed as expected, with the existing reproduction steps passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- authorization, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100