Compare commits
No commits in common. "e4d5afbebe7179c926a0625fd11d17f5285e55a8" and "4a9fd57356132b2fce539724c2faecdc6f160e7f" have entirely different histories.
e4d5afbebe
...
4a9fd57356
@ -1,37 +0,0 @@
|
|||||||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from "typeorm";
|
|
||||||
import {
|
|
||||||
IsInt,
|
|
||||||
IsNotEmpty,
|
|
||||||
IsOptional,
|
|
||||||
IsString,
|
|
||||||
} from "class-validator";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the Permission interface.
|
|
||||||
*/
|
|
||||||
@Entity()
|
|
||||||
export abstract class Permission {
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
import { Entity, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn, Generated, Unique, JoinTable, ManyToMany } from "typeorm";
|
import { Entity, Column, OneToMany, ManyToOne, PrimaryGeneratedColumn, Generated, Unique, JoinTable, ManyToMany } from "typeorm";
|
||||||
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, isUUID, } from "class-validator";
|
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, isUUID, } from "class-validator";
|
||||||
import { UserGroup } from './UserGroup';
|
import { UserGroup } from './UserGroup';
|
||||||
import { Permission } from './Permission';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a admin user.
|
* Defines a admin user.
|
||||||
@ -65,11 +64,11 @@ export class User {
|
|||||||
password: string;
|
password: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* permissions
|
* userpermissions
|
||||||
*/
|
*/
|
||||||
// TODO: Permission implementation
|
// TODO: UserPermission implementation
|
||||||
// @OneToMany(() => Permission,userpermission=>)
|
// @OneToMany(() => UserPermission,userpermission=>)
|
||||||
// permissions: Permission[];
|
// userpermissions: UserPermission[];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* groups
|
* groups
|
||||||
|
@ -1,48 +0,0 @@
|
|||||||
import { PrimaryGeneratedColumn, Column, OneToMany, Entity } from "typeorm";
|
|
||||||
import {
|
|
||||||
IsInt,
|
|
||||||
IsNotEmpty,
|
|
||||||
IsOptional,
|
|
||||||
IsString,
|
|
||||||
} from "class-validator";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the UserAction interface.
|
|
||||||
*/
|
|
||||||
@Entity()
|
|
||||||
export class UserAction {
|
|
||||||
/**
|
|
||||||
* Autogenerated unique id (primary key).
|
|
||||||
*/
|
|
||||||
@PrimaryGeneratedColumn()
|
|
||||||
@IsOptional()
|
|
||||||
@IsInt()
|
|
||||||
id: number;
|
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// user: relation
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actions's target (e.g. Track#2)
|
|
||||||
*/
|
|
||||||
@Column()
|
|
||||||
@IsNotEmpty()
|
|
||||||
@IsString()
|
|
||||||
target: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The actions's action (e.g. UPDATE)
|
|
||||||
*/
|
|
||||||
@Column()
|
|
||||||
@IsNotEmpty()
|
|
||||||
@IsString()
|
|
||||||
action: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The description of change (before-> after; e.g. distance:15->17)
|
|
||||||
*/
|
|
||||||
@Column()
|
|
||||||
@IsOptional()
|
|
||||||
@IsString()
|
|
||||||
changed: string;
|
|
||||||
}
|
|
@ -5,7 +5,7 @@ import {
|
|||||||
IsOptional,
|
IsOptional,
|
||||||
IsString,
|
IsString,
|
||||||
} from "class-validator";
|
} from "class-validator";
|
||||||
import { Permission } from "./Permission";
|
import { User } from "./User";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the UserGroup interface.
|
* Defines the UserGroup interface.
|
||||||
@ -40,5 +40,5 @@ export abstract class UserGroup {
|
|||||||
* TODO: Something about permission stuff
|
* TODO: Something about permission stuff
|
||||||
*/
|
*/
|
||||||
// TODO:
|
// TODO:
|
||||||
// grouppermissions: Permission[];
|
// grouppermissions: GroupPermissions[];
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user