FIX: show group in filter only if user can see the members list. (#16580)

This commit is contained in:
Vinoth Kannan 2022-04-28 18:27:47 +05:30 committed by GitHub
parent 9203a421ba
commit 1928bb6ac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -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);
}); });
} }