45 lines
998 B
TypeScript
45 lines
998 B
TypeScript
import {
|
|
Column,
|
|
CreateDateColumn,
|
|
Entity,
|
|
OneToMany,
|
|
PrimaryGeneratedColumn,
|
|
Relation,
|
|
UpdateDateColumn,
|
|
} from 'typeorm';
|
|
|
|
import { UserWorkspaceRoleEntity } from 'src/engine/metadata-modules/permissions/user-workspace-role.entity';
|
|
|
|
@Entity('role')
|
|
export class RoleEntity {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
id: string;
|
|
|
|
@Column({ nullable: false })
|
|
label: string;
|
|
|
|
@Column({ nullable: false, default: false })
|
|
canUpdateAllSettings: boolean;
|
|
|
|
@Column({ nullable: true, type: 'text' })
|
|
description: string;
|
|
|
|
@Column({ nullable: false, type: 'uuid' })
|
|
workspaceId: string;
|
|
|
|
@CreateDateColumn({ type: 'timestamptz' })
|
|
createdAt: Date;
|
|
|
|
@UpdateDateColumn({ type: 'timestamptz' })
|
|
updatedAt: Date;
|
|
|
|
@Column({ nullable: false, default: true })
|
|
isEditable: boolean;
|
|
|
|
@OneToMany(
|
|
() => UserWorkspaceRoleEntity,
|
|
(userWorkspaceRole: UserWorkspaceRoleEntity) => userWorkspaceRole.role,
|
|
)
|
|
userWorkspaceRoles: Relation<UserWorkspaceRoleEntity[]>;
|
|
}
|