Files
Automata/packages/editor-ui/src/rbac/checks/isAuthenticated.ts
2023-11-28 12:15:08 +01:00

8 lines
310 B
TypeScript

import { useUsersStore } from '@/stores/users.store';
import type { RBACPermissionCheck, AuthenticatedPermissionOptions } from '@/types/rbac';
export const isAuthenticated: RBACPermissionCheck<AuthenticatedPermissionOptions> = () => {
const usersStore = useUsersStore();
return !!usersStore.currentUser;
};