Files
Automata/packages/editor-ui/src/rbac/checks/isAuthenticated.ts
Alex Grozav 4b01335aa4 feat: Add env variables to support exposing /workflows/demo route and /nodes.json route (#8506)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-02-23 18:20:12 +02:00

12 lines
364 B
TypeScript

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