hedgedoc/src/notes/note-permissions.dto.ts

18 lines
391 B
TypeScript
Raw Normal View History

import { IsArray, IsBoolean, ValidateNested } from 'class-validator';
import { UserInfoDto } from '../users/user-info.dto';
export class NotePermissionEntryDto {
@ValidateNested()
user: UserInfoDto;
@IsBoolean()
canEdit: boolean;
}
export class NotePermissionsDto {
@ValidateNested()
owner: UserInfoDto;
@ValidateNested()
@IsArray()
sharedTo: NotePermissionEntryDto[];
}