Untitled

mail@pastecode.io avatar
unknown
typescript
a year ago
496 B
1
Indexable
Never
import { getStateStore } from 'src/global-state/Store';
import { convertParams } from './convertParams';
import { generatePermissions } from './generatePermissions';

const isUserHasPermissions = (requiredPermissions: string[]) => {
  console.log('store is', getStateStore());

  const userPermissions = getStateStore().user.permissions;
  console.log({ userPermissions, requiredPermissions });
  return requiredPermissions.every((permission: string) => userPermissions.includes(permission));
};