Changed minRoleToEdit to STAFF in Components - #1058
Conversation
SzBeni2003
commented
Aug 28, 2026
- where it's not necessarily admins editing the component settings
…ly admins editing the component settings
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| final override var minRole by MinRoleSettingRef(defaultValue = MinRoleSettingRef.ALL_ROLES, | ||
| minRoleToEdit = RoleType.NOBODY, | ||
| minRoleToEdit = RoleType.STAFF, |
There was a problem hiding this comment.
This property is hidden since the minRole property does not make sense for global components. Property minRole only make sense for components of features with dedicated pages. By setting minRoleToEdit to nobody, we are basically hiding this property.
If you want to allow a STAFF user to edit this page, grant them ControlPermissions.PERMISSION_CONTROL_FOOTER.
You must never never allow any modifying action by default for all STAFF users.
There was a problem hiding this comment.
The initial problem is that giving the necessary ControlPermission does not grant the user with STAFF role the permission to view and edit the settings I want to allow them.
The componentSettings thymeleaf template has a check for user.role >= minRole and doesn't render the fields if that's false.
I intended to fix this issue without removing that check, as it is necessary for settings that should only be available to superusers (for example error logs).
|
Do NOT merge this PR |