|
|
@ -16,6 +16,7 @@ import { randomTokenString } from '../../helpers/stringHelpers'; |
|
|
|
import { Audit, ProjectUser, Store, SyncSource, User } from '../../models'; |
|
|
|
import { Audit, ProjectUser, Store, SyncSource, User } from '../../models'; |
|
|
|
|
|
|
|
|
|
|
|
import Noco from '../../Noco'; |
|
|
|
import Noco from '../../Noco'; |
|
|
|
|
|
|
|
import extractRolesObj from '../../utils/extractRolesObj' |
|
|
|
import { MetaTable } from '../../utils/globals'; |
|
|
|
import { MetaTable } from '../../utils/globals'; |
|
|
|
import { ProjectUsersService } from '../project-users/project-users.service'; |
|
|
|
import { ProjectUsersService } from '../project-users/project-users.service'; |
|
|
|
import type { UserType } from 'nocodb-sdk'; |
|
|
|
import type { UserType } from 'nocodb-sdk'; |
|
|
@ -42,7 +43,7 @@ export class OrgUsersService { |
|
|
|
|
|
|
|
|
|
|
|
const user = await User.get(param.userId); |
|
|
|
const user = await User.get(param.userId); |
|
|
|
|
|
|
|
|
|
|
|
if (user.roles.includes(OrgUserRoles.SUPER_ADMIN)) { |
|
|
|
if (extractRolesObj(user.roles)[OrgUserRoles.SUPER_ADMIN]) { |
|
|
|
NcError.badRequest('Cannot update super admin roles'); |
|
|
|
NcError.badRequest('Cannot update super admin roles'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -57,7 +58,7 @@ export class OrgUsersService { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const user = await User.get(param.userId, ncMeta); |
|
|
|
const user = await User.get(param.userId, ncMeta); |
|
|
|
|
|
|
|
|
|
|
|
if (user.roles.includes(OrgUserRoles.SUPER_ADMIN)) { |
|
|
|
if (extractRolesObj(user.roles)[OrgUserRoles.SUPER_ADMIN]) { |
|
|
|
NcError.badRequest('Cannot delete super admin'); |
|
|
|
NcError.badRequest('Cannot delete super admin'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|