UX: Don't display all groups option if group directory is disabled.a

https://meta.discourse.org/t/all-groups-option-leads-to-access-denied-page/88464
This commit is contained in:
Guo Xiang Tan
2018-05-28 11:32:55 +08:00
parent 857a4e0006
commit 0b55416742
4 changed files with 52 additions and 42 deletions

View File

@@ -29,11 +29,15 @@ export default ComboBoxComponent.extend({
@computed
collectionHeader() {
return `
<a href="${Discourse.getURL("/groups")}" class="group-dropdown-filter">
${I18n.t("groups.index.all").toLowerCase()}
</a>
`.htmlSafe();
if (this.siteSettings.enable_group_directory ||
(this.currentUser && this.currentUser.get('staff'))) {
return `
<a href="${Discourse.getURL("/groups")}" class="group-dropdown-filter">
${I18n.t("groups.index.all").toLowerCase()}
</a>
`.htmlSafe();
}
},
actions: {