Skip to content

Changed minRoleToEdit to STAFF in Components - #1058

Closed
SzBeni2003 wants to merge 1 commit into
stagingfrom
fix/write-permissions
Closed

Changed minRoleToEdit to STAFF in Components#1058
SzBeni2003 wants to merge 1 commit into
stagingfrom
fix/write-permissions

Conversation

@SzBeni2003

Copy link
Copy Markdown
Contributor
  • where it's not necessarily admins editing the component settings

@SzBeni2003
SzBeni2003 requested a review from Isti01 August 28, 2026 08:23
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 673304fc-95d4-4093-b284-347e63bd652f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.


final override var minRole by MinRoleSettingRef(defaultValue = MinRoleSettingRef.ALL_ROLES,
minRoleToEdit = RoleType.NOBODY,
minRoleToEdit = RoleType.STAFF,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@Gerviba

Gerviba commented Aug 29, 2026

Copy link
Copy Markdown
Member

Do NOT merge this PR

@Gerviba Gerviba closed this Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants