declare type TPermissionCheck =
  | boolean
  | ((user: TRole, data?: any) => boolean);

declare type TPermission = {
  check: TPermissionCheck;
  description: string;
};

declare type TPermissions = {
  [resource: string]: {
    [action: string]: TPermission;
  };
};

declare type TRole = {
  _id?: string;
  default?: boolean;
  name: string;
  description: string;
  permissions: string[];
  createdAt?: string;
  updatedAt?: string;
  deletedAt?: string;
};
