From 1d5726492286f21adcc6064c62159de8d134538d Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Wed, 2 Dec 2020 18:27:06 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Permissions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/Permission.ts | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/models/Permission.ts diff --git a/src/models/Permission.ts b/src/models/Permission.ts new file mode 100644 index 0000000..4dfeff2 --- /dev/null +++ b/src/models/Permission.ts @@ -0,0 +1,37 @@ +import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from "typeorm"; +import { + IsInt, + IsNotEmpty, + IsOptional, + IsString, +} from "class-validator"; + +/** + * Defines the UserGroup interface. +*/ +@Entity() +export abstract class UserGroup { + /** + * Autogenerated unique id (primary key). + */ + @PrimaryGeneratedColumn() + @IsOptional() + @IsInt() + id: number; + + /** + * The target + */ + @Column() + @IsNotEmpty() + @IsString() + target: string; + + /** + * The action type + */ + @Column() + @IsNotEmpty() + @IsString() + action: string; +} \ No newline at end of file