feat(intial auth): intial auth setup for the scanner
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
Some checks failed
Build and Push LST Docker Image / docker (push) Has been cancelled
This commit is contained in:
@@ -28,9 +28,9 @@ export const zebraScanner = {
|
||||
ZebraScanner.triggerScan();
|
||||
},
|
||||
|
||||
ensureProfile() {
|
||||
ZebraScanner.ensureProfile();
|
||||
},
|
||||
ensureProfile() {
|
||||
ZebraScanner.ensureProfile();
|
||||
},
|
||||
|
||||
addScanListener(
|
||||
callback: (scan: ZebraScanResult) => void,
|
||||
|
||||
13
lstMobile/src/lib/auth.roleCheck.ts
Normal file
13
lstMobile/src/lib/auth.roleCheck.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
const roleRank = {
|
||||
user: 1,
|
||||
lead: 2,
|
||||
manager: 3,
|
||||
admin: 4,
|
||||
} as const;
|
||||
|
||||
export function hasMobileRole(
|
||||
userRole: keyof typeof roleRank,
|
||||
requiredRole: keyof typeof roleRank,
|
||||
) {
|
||||
return roleRank[userRole] >= roleRank[requiredRole];
|
||||
}
|
||||
Reference in New Issue
Block a user