Move Impersonate from User to Workspace (#2630)

* Fix impersonate

* align core typeorm config with metadata config + add allowImpersonation to workspace

* move allowImpersonation to workspace

* remove allowImpersonation from workspaceMember workspace table
This commit is contained in:
Weiko
2023-11-22 14:12:39 +01:00
committed by GitHub
parent 680e9b6aa5
commit a6abe09163
33 changed files with 199 additions and 119 deletions

View File

@ -11,7 +11,7 @@ import { TypeORMService } from 'src/database/typeorm/typeorm.service';
export class UserService extends TypeOrmQueryService<User> {
constructor(
@InjectRepository(User)
@InjectRepository(User, 'core')
private readonly userRepository: Repository<User>,
private readonly dataSourceService: DataSourceService,
private readonly typeORMService: TypeORMService,

View File

@ -23,11 +23,11 @@ export class User {
id: string;
@Field()
@Column({ nullable: true })
@Column({ default: '' })
firstName: string;
@Field()
@Column({ nullable: true })
@Column({ default: '' })
lastName: string;
@Field()

View File

@ -1,6 +1,5 @@
/* eslint-disable no-restricted-imports */
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { NestjsQueryGraphQLModule } from '@ptc-org/nestjs-query-graphql';
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
@ -12,17 +11,17 @@ import { TypeORMService } from 'src/database/typeorm/typeorm.service';
import { DataSourceModule } from 'src/metadata/data-source/data-source.module';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
import config from '../../../ormconfig';
import { userAutoResolverOpts } from './user.auto-resolver-opts';
import { UserService } from './services/user.service';
@Module({
imports: [
TypeOrmModule.forRoot(config),
NestjsQueryGraphQLModule.forFeature({
imports: [NestjsQueryTypeOrmModule.forFeature([User]), TypeORMModule],
imports: [
NestjsQueryTypeOrmModule.forFeature([User], 'core'),
TypeORMModule,
],
resolvers: userAutoResolverOpts,
}),
DataSourceModule,