19 lines
332 B
TypeScript
19 lines
332 B
TypeScript
import { ArrayNotEmpty, IsArray, IsNotEmpty, IsOptional, IsString } from "class-validator";
|
|
|
|
export class CreateRoleDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
name!: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ArrayNotEmpty()
|
|
permissionKeys?: string[];
|
|
}
|
|
|
|
export class SetRolePermissionsDto {
|
|
@IsArray()
|
|
permissionKeys!: string[];
|
|
}
|
|
|