mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-28 17:10:57 -05:00
Add update-DTOs for note permissions and permission entries.
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
11f6358516
commit
0d4c489aa5
1 changed files with 14 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { IsArray, IsBoolean, ValidateNested } from 'class-validator';
|
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
||||||
import { UserInfoDto } from '../users/user-info.dto';
|
import { UserInfoDto } from '../users/user-info.dto';
|
||||||
|
|
||||||
export class NotePermissionEntryDto {
|
export class NotePermissionEntryDto {
|
||||||
|
@ -8,6 +8,13 @@ export class NotePermissionEntryDto {
|
||||||
canEdit: boolean;
|
canEdit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class NotePermissionEntryUpdateDto {
|
||||||
|
@IsString()
|
||||||
|
username: string;
|
||||||
|
@IsBoolean()
|
||||||
|
canEdit: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export class NotePermissionsDto {
|
export class NotePermissionsDto {
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
owner: UserInfoDto;
|
owner: UserInfoDto;
|
||||||
|
@ -15,3 +22,9 @@ export class NotePermissionsDto {
|
||||||
@IsArray()
|
@IsArray()
|
||||||
sharedTo: NotePermissionEntryDto[];
|
sharedTo: NotePermissionEntryDto[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class NotePermissionsUpdateDto {
|
||||||
|
@IsArray()
|
||||||
|
@ValidateNested()
|
||||||
|
sharedTo: NotePermissionEntryUpdateDto[];
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue