resolve confilict

This commit is contained in:
marshal
2026-06-05 14:07:26 +03:00
40 changed files with 3823 additions and 768 deletions

View File

@@ -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,