Files
dbis_monorepo/packages/shared-auth/src/index.ts
defiQUG f32bcd596f
Some checks failed
DBIS Monorepo CI / Build (push) Has been cancelled
DBIS Monorepo CI / Lint (push) Has been cancelled
DBIS Monorepo CI / Type Check (push) Has been cancelled
DBIS Monorepo CI / Test (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:45 -08:00

20 lines
498 B
TypeScript

/**
* @dbis/shared-auth
* Shared authentication utilities for DBIS projects
*/
// Re-export workspace shared auth
export * from '@workspace/shared-auth';
// DBIS-specific auth utilities
export function hasDBISRole(user: { roles: string[] }, role: string): boolean {
return user.roles.includes(role);
}
export function requireDBISRole(user: { roles: string[] }, role: string): void {
if (!hasDBISRole(user, role)) {
throw new Error(`User does not have required role: ${role}`);
}
}