Display delegated section in common settings for delegated non-admin#55511
Conversation
|
(sorry, I confused tabs, ignore my last changes here) |
f942e16 to
189c703
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
2643ab1 to
2335869
Compare
2335869 to
09204a1
Compare
come-nc
left a comment
There was a problem hiding this comment.
Hello, thank you for the PR.
Could you instead use a try/catch around the call to getFormsWithValues ?
If you catch OC\AppFramework\Middleware\Security\Exceptions\NotAdminException you can simply continue with an empty array for declarative settings.
That avoid duplicating the logic for testing admin rights, and if later declarative settings support delegation it will keep working.
09204a1 to
416aec0
Compare
…or 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>
416aec0 to
3d4d5fe
Compare
Summary
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
Before state
login and check Administration * Basic Settings
e.g. open http://localhost:8080/index.php/settings/admin
Observe: Access forbidden
After state
Todo
Checklist
3. to review, feature component)stable32)