mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-13 07:15:39 +01:00
add roles to users
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
import { Exclude } from 'class-transformer';
|
||||
import {
|
||||
IsDefined,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
} from 'class-validator';
|
||||
import { IsArray, IsEnum, IsNotEmpty, IsOptional } from 'class-validator';
|
||||
import { Roles, RolesList } from '../dto/roles.dto';
|
||||
|
||||
export class EUser {
|
||||
@IsOptional()
|
||||
@@ -12,8 +9,9 @@ export class EUser {
|
||||
@IsNotEmpty()
|
||||
username: string;
|
||||
|
||||
@IsDefined()
|
||||
isAdmin: boolean;
|
||||
@IsArray()
|
||||
@IsEnum(RolesList, { each: true })
|
||||
roles: Roles;
|
||||
|
||||
@IsOptional()
|
||||
@Exclude()
|
||||
|
||||
Reference in New Issue
Block a user