mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 16:28:12 +00:00
resolve confilict
This commit is contained in:
@@ -44,6 +44,19 @@ export function isSuperAdmin(user: AuthUser | null | undefined): boolean {
|
||||
return Boolean(user?.roles?.some((r) => r.key === "super_admin"));
|
||||
}
|
||||
|
||||
/** Org-level admins may act on any approval step in the chain. */
|
||||
export function isOrganizationAdmin(
|
||||
user: AuthUser | null | undefined,
|
||||
): boolean {
|
||||
return Boolean(user?.roles?.some((r) => r.key === "organization_admin"));
|
||||
}
|
||||
|
||||
export function isFreightApprovalAdmin(
|
||||
user: AuthUser | null | undefined,
|
||||
): boolean {
|
||||
return isSuperAdmin(user) || isOrganizationAdmin(user);
|
||||
}
|
||||
|
||||
export function hasPermission(
|
||||
user: AuthUser | null | undefined,
|
||||
key: string,
|
||||
|
||||
Reference in New Issue
Block a user