FIX: Do not show topic admin menu button to regular users (#26820)
This commit is contained in:
parent
3930064fd1
commit
ff8e1f4ed6
|
@ -72,7 +72,16 @@ export default class TopicAdminMenu extends Component {
|
|||
return getURL(`/review?topic_id=${this.args.topic.id}&status=all`);
|
||||
}
|
||||
|
||||
get showAdminButton() {
|
||||
return (
|
||||
this.currentUser?.canManageTopic ||
|
||||
this.details?.can_archive_topic ||
|
||||
this.details?.can_close_topic
|
||||
);
|
||||
}
|
||||
|
||||
<template>
|
||||
{{#if this.showAdminButton}}
|
||||
<span class="topic-admin-menu-button-container">
|
||||
<span class="topic-admin-menu-button">
|
||||
<DMenu
|
||||
|
@ -174,7 +183,8 @@ export default class TopicAdminMenu extends Component {
|
|||
|
||||
{{#if
|
||||
(and
|
||||
this.details.can_archive_topic (not this.isPrivateMessage)
|
||||
this.details.can_archive_topic
|
||||
(not this.isPrivateMessage)
|
||||
)
|
||||
}}
|
||||
<li class="topic-admin-archive">
|
||||
|
@ -223,7 +233,11 @@ export default class TopicAdminMenu extends Component {
|
|||
"convertToPrivateMessage"
|
||||
)
|
||||
}}
|
||||
@icon={{if this.isPrivateMessage "comment" "envelope"}}
|
||||
@icon={{if
|
||||
this.isPrivateMessage
|
||||
"comment"
|
||||
"envelope"
|
||||
}}
|
||||
/>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -235,7 +249,10 @@ export default class TopicAdminMenu extends Component {
|
|||
<DButton
|
||||
class="btn-transparent"
|
||||
@label="topic.actions.timed_update"
|
||||
@action={{fn this.onButtonAction "showTopicTimerModal"}}
|
||||
@action={{fn
|
||||
this.onButtonAction
|
||||
"showTopicTimerModal"
|
||||
}}
|
||||
@icon="far-clock"
|
||||
/>
|
||||
</li>
|
||||
|
@ -295,7 +312,10 @@ export default class TopicAdminMenu extends Component {
|
|||
@label={{button.label}}
|
||||
@translatedLabel={{button.translatedLabel}}
|
||||
@icon={{button.icon}}
|
||||
class={{concatClass "btn-transparent" button.className}}
|
||||
class={{concatClass
|
||||
"btn-transparent"
|
||||
button.className
|
||||
}}
|
||||
@action={{fn this.onExtraButtonAction button.action}}
|
||||
/>
|
||||
</li>
|
||||
|
@ -307,5 +327,6 @@ export default class TopicAdminMenu extends Component {
|
|||
</DMenu>
|
||||
</span>
|
||||
</span>
|
||||
{{/if}}
|
||||
</template>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue