@@ -0,0 +1,9 @@
|
||||
import { usePage } from '@inertiajs/react';
|
||||
import type { WorkContextState } from '@/types/work-context';
|
||||
|
||||
export function useProcurementPreparationIdentity(scope: string) {
|
||||
const { auth, workContext, organizationAccess } = usePage().props;
|
||||
const context = workContext as WorkContextState | null | undefined;
|
||||
const access = organizationAccess as { permissions?: string[] } | null;
|
||||
return `procurement-preparations:${auth?.user?.tenant_id}:${auth?.user?.id}:${context?.active ?? 'legacy'}:${[...(access?.permissions ?? [])].sort().join(',')}:${scope}`;
|
||||
}
|
||||
Reference in New Issue
Block a user