Implemented new Permission system on the DB side.

ref #22
This commit is contained in:
2020-12-17 20:46:54 +01:00
parent 39b932a81c
commit cc5a30980a
6 changed files with 64 additions and 56 deletions
+4 -17
View File
@@ -1,29 +1,16 @@
import {
IsInt,
IsNotEmpty,
IsOptional,
IsString
} from "class-validator";
import { Column, Entity, ManyToOne, PrimaryGeneratedColumn } from "typeorm";
import { Permission } from "./Permission";
import { ChildEntity, Column } from "typeorm";
import { Principal } from './Principal';
/**
* Defines the UserGroup interface.
*/
@Entity()
export class UserGroup {
/**
* Autogenerated unique id (primary key).
*/
@PrimaryGeneratedColumn()
@IsInt()
id: number;
/**
* permissions
*/
@ManyToOne(() => Permission, permission => permission.groups, { nullable: true })
permissions: Permission[];
@ChildEntity()
export class UserGroup extends Principal {
/**
* The group's name