Skip to content

Commit

Permalink
fix(context-list): profils are checked by defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-André Barbeau committed Sep 8, 2020
1 parent b67058d commit b1a7171
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,21 +257,27 @@ export class ContextListBindingDirective implements OnInit, OnDestroy {
acc = cur.childs ? acc.concat(cur.childs) : acc;
return acc;
}, []);

for (const user of profilsAcc) {
const permission: ContextUserPermission = {
name: user.name,
checked: this.storageService.get(
'contexts.permissions.' + user.name
) as boolean
};
if (permission.checked === null) {
permission.checked = true;
}
this.component.permissions.push(permission);
}

const permissions = ['none'];
for (const p of this.component.permissions) {
if (p.checked === true || p.indeterminate === true) {
permissions.push(p.name);
}
}

this.component.showHidden
? this.contextService.loadContexts(permissions, true)
: this.contextService.loadContexts(permissions, false);
Expand Down

0 comments on commit b1a7171

Please sign in to comment.