pull/3895/head
Jamie Rees 6 years ago
parent b4bf86f03e
commit 3a0040031c

@ -59,8 +59,10 @@ export class AuthService extends ServiceHelpers {
} }
public hasRole(role: string): boolean { public hasRole(role: string): boolean {
if (this.claims().roles) { const claims = this.claims();
return this.claims().roles.some(r => r.toUpperCase() === role.toUpperCase());
if (claims && claims.roles && role) {
return claims.roles.some(r => r.toUpperCase() === role.toUpperCase());
} }
return false; return false;
} }

Loading…
Cancel
Save