mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
constant change
This commit is contained in:
parent
1855d676e0
commit
fb5f218769
2 changed files with 8 additions and 2 deletions
|
|
@ -103,7 +103,7 @@ export const DEFAULT_GROUP_PERMISSIONS_MIGRATIONS = {
|
|||
export const ERROR_HANDLER = {
|
||||
GROUP_NOT_EXIST: "Group doesn't exist",
|
||||
RESERVED_KEYWORDS_FOR_GROUP_NAME: 'Group name cannot be same as reserved keywords',
|
||||
DEFAULT_GROUP_NAME: 'Name cannot be same as user default group',
|
||||
DEFAULT_GROUP_NAME: 'Group name already exists',
|
||||
DEFAULT_GROUP_NAME_UPDATE: 'Not allowed to change default group name',
|
||||
DEFAULT_GROUP_NAME_DELETE: 'Not allowed to delete default group',
|
||||
NON_EDITABLE_GROUP_UPDATE: 'Group cannot be update because its not allowed',
|
||||
|
|
|
|||
|
|
@ -136,9 +136,15 @@ export function getAllUserGroupsQuery(
|
|||
}
|
||||
|
||||
export function validateCreateGroupOperation(createGroupPermissionDto: CreateGroupPermissionDto) {
|
||||
console.log('this is running');
|
||||
|
||||
const humanizeList = ['End-user', 'Builder', 'Admin'];
|
||||
if (humanizeList.includes(createGroupPermissionDto.name))
|
||||
|
||||
if (humanizeList.includes(createGroupPermissionDto.name)) {
|
||||
console.log('this is running');
|
||||
|
||||
throw new BadRequestException(ERROR_HANDLER.DEFAULT_GROUP_NAME);
|
||||
}
|
||||
|
||||
if (Object.values(USER_ROLE).includes(createGroupPermissionDto.name as USER_ROLE))
|
||||
throw new BadRequestException(ERROR_HANDLER.RESERVED_KEYWORDS_FOR_GROUP_NAME);
|
||||
|
|
|
|||
Loading…
Reference in a new issue