|
|
@@ -1,5 +1,7 @@
|
|
|
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
|
|
|
|
|
+export type Permission = string;
|
|
|
+
|
|
|
@Entity()
|
|
|
export class Role {
|
|
|
@PrimaryGeneratedColumn()
|
|
|
@@ -11,7 +13,13 @@ export class Role {
|
|
|
@Column({ type: 'text', nullable: true })
|
|
|
description?: string;
|
|
|
|
|
|
+ @Column({ type: 'simple-array', nullable: false })
|
|
|
+ permissions: Permission[] = [];
|
|
|
+
|
|
|
constructor(partial?: Partial<Role>) {
|
|
|
Object.assign(this, partial);
|
|
|
+ if (!this.permissions) {
|
|
|
+ this.permissions = [];
|
|
|
+ }
|
|
|
}
|
|
|
}
|