Skip to content

Commit

Permalink
IKC-349 Kouncil demo 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Belke authored and Piotr Belke committed Feb 16, 2024
1 parent 619cd2e commit 65a66d1
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export class AuthDemoService implements AuthService {
}

canAccess(roles: KouncilRole[]): boolean {
const localStorageUserRoles = JSON.parse(localStorage.getItem(this.USER_ROLES));
if (this.userRoles.length === 0 && localStorageUserRoles.length > 0) {
this.userRoles = localStorageUserRoles;
}
return this.userRoles.some(userRole => roles.includes(userRole));
}

Expand Down

0 comments on commit 65a66d1

Please sign in to comment.