mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: show group in filter only if user can see the members list. (#16580)
This commit is contained in:
@@ -69,12 +69,14 @@ export default Controller.extend({
|
||||
loadGroups() {
|
||||
if (this.currentUser) {
|
||||
return Group.findAll({ ignore_automatic: true }).then((groups) => {
|
||||
const groupOptions = groups.map((group) => {
|
||||
return {
|
||||
name: group.full_name || group.name,
|
||||
id: group.name,
|
||||
};
|
||||
});
|
||||
const groupOptions = groups
|
||||
.filter((group) => group.can_see_members)
|
||||
.map((group) => {
|
||||
return {
|
||||
name: group.full_name || group.name,
|
||||
id: group.name,
|
||||
};
|
||||
});
|
||||
this.set("groupOptions", groupOptions);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user