mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-11-29 04:23:22 +00:00
* feat(Map): Lock systems available to manager/admin roles only * feat(Map): Fix add system & add acl member select behaviour
12 lines
415 B
TypeScript
12 lines
415 B
TypeScript
import { useMemo } from 'react';
|
|
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
|
import { UserPermission } from '@/hooks/Mapper/types/permissions.ts';
|
|
|
|
export const useMapCheckPermissions = (permissions: UserPermission[]) => {
|
|
const {
|
|
data: { userPermissions },
|
|
} = useMapRootState();
|
|
|
|
return useMemo(() => permissions.every(x => userPermissions[x]), [permissions, userPermissions]);
|
|
};
|