FIX: show group in filter only if user can see the members list. (#16580)
This commit is contained in:
parent
9203a421ba
commit
1928bb6ac6
|
@ -69,12 +69,14 @@ export default Controller.extend({
|
||||||
loadGroups() {
|
loadGroups() {
|
||||||
if (this.currentUser) {
|
if (this.currentUser) {
|
||||||
return Group.findAll({ ignore_automatic: true }).then((groups) => {
|
return Group.findAll({ ignore_automatic: true }).then((groups) => {
|
||||||
const groupOptions = groups.map((group) => {
|
const groupOptions = groups
|
||||||
return {
|
.filter((group) => group.can_see_members)
|
||||||
name: group.full_name || group.name,
|
.map((group) => {
|
||||||
id: group.name,
|
return {
|
||||||
};
|
name: group.full_name || group.name,
|
||||||
});
|
id: group.name,
|
||||||
|
};
|
||||||
|
});
|
||||||
this.set("groupOptions", groupOptions);
|
this.set("groupOptions", groupOptions);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue