Introduce userWorkspaceRoles and Roles + seed standard admin role at workspace creation (#9929)

Closes https://github.com/twentyhq/core-team-issues/issues/303
This commit is contained in:
Marie
2025-01-30 16:05:33 +01:00
committed by GitHub
parent e895aa27e6
commit 3a78e6f889
10 changed files with 279 additions and 2 deletions

View File

@ -0,0 +1,15 @@
import { CustomException } from 'src/utils/custom-exception';
export class PermissionsException extends CustomException {
code: PermissionsExceptionCode;
constructor(message: string, code: PermissionsExceptionCode) {
super(message, code);
}
}
export enum PermissionsExceptionCode {
ADMIN_ROLE_NOT_FOUND = 'ADMIN_ROLE_NOT_FOUND',
USER_WORKSPACE_NOT_FOUND = 'USER_WORKSPACE_NOT_FOUND',
WORKSPACE_ID_ROLE_USER_WORKSPACE_MISMATCH = 'WORKSPACE_ID_ROLE_USER_WORKSPACE_MISMATCH',
TOO_MANY_ADMIN_CANDIDATES = 'TOO_MANY_ADMIN_CANDIDATES',
}