Merge remote-tracking branch 'origin/uate' into dev
This commit is contained in:
@@ -416,6 +416,14 @@ export class AuthenticationService {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Returns true when the logged-in user has the "Cashier" role. */
|
||||
hasCashierRole(): boolean {
|
||||
const creds = this.getCredentials();
|
||||
if (!creds || !creds.roles) return false;
|
||||
const roleNames: string[] = (creds.roles as any[]).map((r) => (r.name || r.role || '').toLowerCase().trim());
|
||||
return roleNames.some((n) => n === 'cashier');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user credentials.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user