Add fields for admin panel access and workspace version (#10451)
Prepare for better version upgrade system + split admin panel into two permissions + fix GraphQL generation detection --------- Co-authored-by: ehconitin <nitinkoche03@gmail.com>
This commit is contained in:
@ -207,6 +207,7 @@ export class SignInUpService {
|
||||
const userToCreate = this.userRepository.create({
|
||||
...newUser,
|
||||
defaultAvatarUrl: imagePath,
|
||||
canAccessFullAdminPanel: false,
|
||||
canImpersonate: false,
|
||||
} as Partial<User>);
|
||||
|
||||
@ -289,6 +290,7 @@ export class SignInUpService {
|
||||
const user: PartialUserWithPicture = {
|
||||
...partialUserWithPicture,
|
||||
canImpersonate: false,
|
||||
canAccessFullAdminPanel: false,
|
||||
};
|
||||
|
||||
if (!user.email) {
|
||||
@ -303,6 +305,7 @@ export class SignInUpService {
|
||||
|
||||
// if the workspace doesn't exist it means it's the first user of the workspace
|
||||
user.canImpersonate = true;
|
||||
user.canAccessFullAdminPanel = true;
|
||||
|
||||
// let the creation of the first workspace
|
||||
if (workspacesCount > 0) {
|
||||
|
||||
@ -69,6 +69,10 @@ export class User {
|
||||
@Column({ default: false })
|
||||
canImpersonate: boolean;
|
||||
|
||||
@Field()
|
||||
@Column({ default: false })
|
||||
canAccessFullAdminPanel: boolean;
|
||||
|
||||
@Field()
|
||||
@CreateDateColumn({ type: 'timestamptz' })
|
||||
createdAt: Date;
|
||||
|
||||
@ -15,12 +15,12 @@ import {
|
||||
|
||||
import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
|
||||
import { AppToken } from 'src/engine/core-modules/app-token/app-token.entity';
|
||||
import { ApprovedAccessDomain } from 'src/engine/core-modules/approved-access-domain/approved-access-domain.entity';
|
||||
import { FeatureFlag } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
|
||||
import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-pair.entity';
|
||||
import { PostgresCredentials } from 'src/engine/core-modules/postgres-credentials/postgres-credentials.entity';
|
||||
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
|
||||
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
|
||||
import { ApprovedAccessDomain } from 'src/engine/core-modules/approved-access-domain/approved-access-domain.entity';
|
||||
|
||||
registerEnumType(WorkspaceActivationStatus, {
|
||||
name: 'WorkspaceActivationStatus',
|
||||
@ -150,4 +150,8 @@ export class Workspace {
|
||||
@Field()
|
||||
@Column({ default: false })
|
||||
isCustomDomainEnabled: boolean;
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
@Column({ type: 'varchar', nullable: true })
|
||||
version: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user