refactor(core): Standardize filename casing for controllers and databases (no-changelog) (#10564)
This commit is contained in:
29
packages/cli/src/databases/entities/project-relation.ts
Normal file
29
packages/cli/src/databases/entities/project-relation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Column, Entity, ManyToOne, PrimaryColumn } from '@n8n/typeorm';
|
||||
import { User } from './User';
|
||||
import { WithTimestamps } from './abstract-entity';
|
||||
import { Project } from './project';
|
||||
|
||||
// personalOwner is only used for personal projects
|
||||
export type ProjectRole =
|
||||
| 'project:personalOwner'
|
||||
| 'project:admin'
|
||||
| 'project:editor'
|
||||
| 'project:viewer';
|
||||
|
||||
@Entity()
|
||||
export class ProjectRelation extends WithTimestamps {
|
||||
@Column()
|
||||
role: ProjectRole;
|
||||
|
||||
@ManyToOne('User', 'projectRelations')
|
||||
user: User;
|
||||
|
||||
@PrimaryColumn('uuid')
|
||||
userId: string;
|
||||
|
||||
@ManyToOne('Project', 'projectRelations')
|
||||
project: Project;
|
||||
|
||||
@PrimaryColumn()
|
||||
projectId: string;
|
||||
}
|
||||
Reference in New Issue
Block a user