FIX: Update Re-assign view permissions (#241)
Only show mobile re-assign options if user has permission to assign Fixes: https://meta.discourse.org/t/discourse-assign/58044/155?u=isaacjanzen
This commit is contained in:
parent
ab0c63b1fb
commit
28fbcac11e
|
@ -238,7 +238,7 @@ function registerTopicFooterButtons(api) {
|
||||||
dependentKeys: DEPENDENT_KEYS,
|
dependentKeys: DEPENDENT_KEYS,
|
||||||
displayed() {
|
displayed() {
|
||||||
// only display the button in the mobile view
|
// only display the button in the mobile view
|
||||||
return this.site.mobileView;
|
return this.currentUser?.can_assign && this.site.mobileView;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -282,7 +282,11 @@ function registerTopicFooterButtons(api) {
|
||||||
dependentKeys: DEPENDENT_KEYS,
|
dependentKeys: DEPENDENT_KEYS,
|
||||||
displayed() {
|
displayed() {
|
||||||
// only display the button in the mobile view
|
// only display the button in the mobile view
|
||||||
return this.site.mobileView && this.topic.isAssigned();
|
return (
|
||||||
|
this.currentUser?.can_assign &&
|
||||||
|
this.site.mobileView &&
|
||||||
|
this.topic.isAssigned()
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -328,6 +332,7 @@ function registerTopicFooterButtons(api) {
|
||||||
return (
|
return (
|
||||||
// only display the button in the mobile view
|
// only display the button in the mobile view
|
||||||
this.site.mobileView &&
|
this.site.mobileView &&
|
||||||
|
this.currentUser?.can_assign &&
|
||||||
this.topic.isAssigned() &&
|
this.topic.isAssigned() &&
|
||||||
this.get("topic.assigned_to_user")?.username !==
|
this.get("topic.assigned_to_user")?.username !==
|
||||||
this.currentUser.username
|
this.currentUser.username
|
||||||
|
@ -373,7 +378,7 @@ function registerTopicFooterButtons(api) {
|
||||||
dependentKeys: DEPENDENT_KEYS,
|
dependentKeys: DEPENDENT_KEYS,
|
||||||
displayed() {
|
displayed() {
|
||||||
// only display the button in the mobile view
|
// only display the button in the mobile view
|
||||||
return this.site.mobileView;
|
return this.currentUser?.can_assign && this.site.mobileView;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue