From 713e2ada31655701624dd5669f1a16d73996d8d3 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sat, 3 Oct 2020 12:42:14 +0200 Subject: [PATCH] Update NotePermissionsUpdate DTOs to be aware of groups The NotePermissionsUpdateDto was not updated when group permissions were introduced. Signed-off-by: David Mehren Co-authored-by: Yannick Bungers --- src/notes/note-permissions.dto.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/notes/note-permissions.dto.ts b/src/notes/note-permissions.dto.ts index 8df0aa894..e6a079976 100644 --- a/src/notes/note-permissions.dto.ts +++ b/src/notes/note-permissions.dto.ts @@ -8,7 +8,7 @@ export class NoteUserPermissionEntryDto { canEdit: boolean; } -export class NotePermissionEntryUpdateDto { +export class NoteUserPermissionUpdateDto { @IsString() username: string; @IsBoolean() @@ -31,6 +31,13 @@ export class NoteGroupPermissionEntryDto { canEdit: boolean; } +export class NoteGroupPermissionUpdateDto { + @IsString() + groupname: string; + @IsBoolean() + canEdit: boolean; +} + export class NotePermissionsDto { @ValidateNested() owner: UserInfoDto; @@ -45,5 +52,8 @@ export class NotePermissionsDto { export class NotePermissionsUpdateDto { @IsArray() @ValidateNested() - sharedTo: NotePermissionEntryUpdateDto[]; + sharedToUsers: NoteUserPermissionUpdateDto[]; + @IsArray() + @ValidateNested() + sharedToGroups: NoteGroupPermissionUpdateDto[]; }