Implemented permission getting

ref #6
This commit is contained in:
2020-12-18 15:12:06 +01:00
parent 388fc6ba6a
commit d89fcb84a2
5 changed files with 180 additions and 10 deletions

View File

@@ -1,24 +1,19 @@
import {
IsArray,
IsBoolean,
IsInt,
IsOptional,
IsString
} from "class-validator";
import { Permission } from '../entities/Permission';
import { User } from '../entities/User';
import { UserGroup } from '../entities/UserGroup';
import { ResponsePrincipal } from './ResponsePrincipal';
/**
* Defines a user response.
*/
export class ResponseUser {
/**
* Autogenerated unique id (primary key).
*/
@IsInt()
id: number;;
export class ResponseUser extends ResponsePrincipal {
/**
* The user's first name.
*/
@@ -80,7 +75,7 @@ export class ResponseUser {
permissions: Permission[];
public constructor(user: User) {
this.id = user.id;
super(user);
this.firstname = user.firstname;
this.middlename = user.middlename;
this.lastname = user.lastname;