FIX: Disallow moderators from custom public sidebar sections (#23683)

Currently moderators can see the custom public sidebar section edit button, but they are prevented from making any changes by an error. According to the back-end, moderators can not access these.

This PR hides the custom public sidebar section edit button, as well as the "make public" checkbox of the create modal, if the user is not an admin, bringing the UI in line with the back-end.

If needed, we can add a site setting to allow moderator access when the need arises.
This commit is contained in:
Ted Johansson 2023-09-27 19:52:23 +02:00 committed by GitHub
parent ca394177cb
commit 7569b64362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -83,7 +83,7 @@
/>
{{/if}}
{{#if (and this.currentUser.staff)}}
{{#if (and this.currentUser.admin)}}
<div
class="row-wrapper mark-public-wrapper
{{if this.transformedModel.sectionType '-disabled'}}"

View File

@ -37,7 +37,7 @@ export default class Section {
}
get headerActions() {
if (!this.section.public || this.currentUser?.staff) {
if (!this.section.public || this.currentUser?.admin) {
return [
{
action: () => {