Skip to content

Commit

Permalink
return values from mapRoleToPriority
Browse files Browse the repository at this point in the history
  • Loading branch information
olasunkanmi-SE committed Dec 5, 2023
1 parent e587431 commit 4a8de90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/src/shared/services/access_control.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ export class AccessControlService implements IAccessControlService {
this.mapRoleToPriority();
}

private mapRoleToPriority(): void {
private mapRoleToPriority(): Map<string, number> {
const sortedRoles = this.roleService.sortRoles(Object.values(Role));
if (sortedRoles?.length) {
sortedRoles.reduce((map, role) => {
const rolesPriorityMap = sortedRoles.reduce((map, role) => {
map.set(role, this.priority);
this.priority++;
this.hierarchies.push(map);
return map;
}, new Map<string, number>());
return rolesPriorityMap;
}
}

Expand Down

0 comments on commit 4a8de90

Please sign in to comment.