You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(subadmin): disable group-admin feature by default behind allow_subadmins (#41634)
* fix(subadmin): disable group-admin feature by default behind allow_subadmins
The subadmin (group-admin) feature lets an admin delegate user management
of specific groups to a non-admin user. The related code path has known
security shortcomings, so the feature is now disabled by default as a
risk-mitigation. Deployments that rely on it can opt back in by setting
the new `allow_subadmins` system config to true.
Enforcement is centralized in the OC\SubAdmin manager, the single chokepoint
all consumers route through:
- isSubAdmin() keeps the real-admin short-circuit, then returns false for
group-admin-only users when disabled, cascading to permission bypasses,
legacy guards and the settings middleware.
- Read methods (isSubAdminofGroup, getSubAdminsGroups, getGroupsSubAdmins,
getAllSubAdmins) behave as if no subadmins exist.
- createSubAdmin throws HintException; the two write callers
(togglesubadmins.php, provisioning_api addSubAdmin) surface a clean error.
- deleteSubAdmin and the post-delete cleanup hooks stay enabled so admins
can prune dormant assignments.
The Users settings page hides the group-admin column when disabled, and the
option is documented in config.sample.php with a security note.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
* test: add acceptance test for when the subadmin feature is disabled
* chore: add changelog for allow_subadmins setting
* fix(subadmin): strict boolean gate and single-source isEnabled()
Address remaining review feedback on the allow_subadmins gate:
- Tighten the gate to a strict `=== true` check so only the documented
boolean opt-in enables the feature; string values such as 'false' or
'0' in a hand-edited config.php now fail closed instead of fail open.
- Make SubAdmin::isEnabled() public and route settings/users.php through
it, removing the duplicated inline config read so the gate has a single
source of truth in the OC\SubAdmin manager.
- Document the breaking upgrade behavior in the changelog: existing
group-admin assignments are ignored until allow_subadmins => true.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
---------
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Phillip Davis <phil@jankaritech.com>
Copy file name to clipboardExpand all lines: tests/acceptance/features/apiProvisioning-v1/createSubAdmin.feature
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,15 @@ Feature: create a subadmin
25
25
And the HTTP status code should be "200"
26
26
And user "nonexistentuser" should not be a subadmin of group "brand-new-group"
27
27
28
+
@smokeTest
29
+
Scenario: admin tries to create a subadmin when the subadmin feature is disabled
30
+
Given user "brand-new-user" has been created with default attributes and without skeleton files
31
+
And group "brand-new-group" has been created
32
+
When the administrator tries to make user "brand-new-user" a subadmin of group "brand-new-group" using the provisioning API with the subadmin feature disabled
33
+
Then the OCS status code should be "103"
34
+
And the HTTP status code should be "200"
35
+
And user "brand-new-user" should not be a subadmin of group "brand-new-group"
36
+
28
37
29
38
Scenario: admin tries to create a subadmin using a group which does not exist
30
39
Given user "brand-new-user" has been created with default attributes and without skeleton files
0 commit comments