-
Notifications
You must be signed in to change notification settings - Fork 0
extend admin-delegation #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
14a3820 to
f98a2a6
Compare
6354f42 to
1085e55
Compare
2e4472d to
075bd0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR extends the admin delegation functionality to hide admin settings from regular admins when only delegated settings are enabled. The feature introduces a system configuration that allows super-admins to restrict access to admin settings, making them visible only through delegation mechanisms.
- Adds support for
settings.only-delegated-settingssystem configuration to control delegation behavior - Modifies navigation to show unified Settings entry instead of separate personal/admin entries when delegation is enabled
- Updates admin settings filtering logic to respect the delegation configuration
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/lib/Settings/ManagerTest.php | Adds test coverage for delegation-aware admin settings filtering |
| tests/lib/NavigationManagerTest.php | Tests navigation behavior with delegated settings enabled/disabled |
| lib/private/Settings/Manager.php | Implements delegation logic in getAllowedAdminSettings method |
| lib/private/NavigationManager.php | Modifies navigation entries based on delegation configuration |
| apps/settings/tests/Settings/Admin/DelegationTest.php | New test file for Delegation settings class |
| apps/settings/lib/Settings/Admin/Delegation.php | Updates Delegation class to implement IDelegatedSettings |
| apps/settings/lib/Command/AdminDelegation/Show.php | Enhances show command with structured output formats |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
075bd0a to
7747522
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
0f63b4f to
cef9e60
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ->withConsecutive( | ||
| ['available-settings', []], | ||
| ['available-groups', [['displayName' => 'Users', 'gid' => 'users']]], | ||
| ['authorized-groups', []], | ||
| ['authorized-settings-doc-link', 'https://docs.example.com/admin-delegation'] | ||
| ); |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The withConsecutive() method is deprecated in newer PHPUnit versions. Consider using separate with() expectations or the willReturnCallback() method to verify the calls individually.
9166bdb to
df877da
Compare
…edGroupService Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…tedSettings Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…r and NavigationManager Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…tructor Prevent initSettingState to reload already filtered delegated states of settingManager for current user. Fixes rendering of delegated sections in apps/settings/templates/settings/frame.php While browsing to /settings/admin/admindelegation Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…ings for non-admin IDeclarativeSettingsForm can't be delegated and can be shown only to admin. Lets not load IDeclarativeSettings for non admins. Otherwise we get "Access forbidden" while displaying /settings/admin and prevent to show delegated sections to non admin like: Background jobs OCA\Settings\Settings\Admin\Server Email server OCA\Settings\Settings\Admin\Mail Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…ttings for non-admin users Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
…settings feature) https://github.com/IONOS-Productivity/ncw-config/releases/tag/0d518e2 Signed-off-by: Misha M.-Kupriyanov <kupriyanov@strato.de>
df877da to
f13355f
Compare
Summary
Use delegation to hide from admins settings allowed only for "super-admin"
occ admin-delegation:addnextcloud/server#46617turn off delegation
occ config:system:set --type boolean --value false -- settings.only-delegated-settingsscript to delegate all settings to admin group
delegate_all.sh
To run tests use the
tests/phpunit-autotest-settings.xml
TODO
Checklist