mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
FIX: Only show remove timer button to users with permission to do so
This commit is contained in:
parent
f1c67729de
commit
fca2f0f212
@ -1,6 +1,8 @@
|
||||
import { iconHTML } from "discourse-common/lib/icon-library";
|
||||
import { bufferedRender } from "discourse-common/lib/buffered-render";
|
||||
import Category from "discourse/models/category";
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import { REMINDER_TYPE } from "discourse/controllers/edit-topic-timer";
|
||||
|
||||
export default Ember.Component.extend(
|
||||
bufferedRender({
|
||||
@ -16,6 +18,12 @@ export default Ember.Component.extend(
|
||||
"categoryId"
|
||||
],
|
||||
|
||||
@computed("statusType")
|
||||
canRemoveTimer(type) {
|
||||
if (type === REMINDER_TYPE) return true;
|
||||
return this.currentUser && this.currentUser.get("canManageTopic");
|
||||
},
|
||||
|
||||
buildBuffer(buffer) {
|
||||
if (!this.executeAt) return;
|
||||
|
||||
@ -65,7 +73,7 @@ export default Ember.Component.extend(
|
||||
"far-clock"
|
||||
)} ${I18n.t(this._noticeKey(), options)}</span>`
|
||||
);
|
||||
if (this.removeTopicTimer) {
|
||||
if (this.removeTopicTimer && this.canRemoveTimer) {
|
||||
buffer.push(
|
||||
`<button class="btn topic-timer-remove no-text" title="${I18n.t(
|
||||
"post.controls.remove_timer"
|
||||
|
Loading…
Reference in New Issue
Block a user