mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-29 06:03:44 +00:00
Adapt permission DTOs for group permissions
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
84b7840ce3
commit
ea217b3613
1 changed files with 19 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
||||
import { UserInfoDto } from '../users/user-info.dto';
|
||||
|
||||
export class NotePermissionEntryDto {
|
||||
export class NoteUserPermissionEntryDto {
|
||||
@ValidateNested()
|
||||
user: UserInfoDto;
|
||||
@IsBoolean()
|
||||
|
@ -15,12 +15,29 @@ export class NotePermissionEntryUpdateDto {
|
|||
canEdit: boolean;
|
||||
}
|
||||
|
||||
export class GroupInfoDto {
|
||||
@IsString()
|
||||
id: string
|
||||
@IsString()
|
||||
displayName: string
|
||||
}
|
||||
|
||||
export class NoteGroupPermissionEntryDto {
|
||||
@ValidateNested()
|
||||
group: GroupInfoDto
|
||||
@IsBoolean()
|
||||
canEdit: boolean
|
||||
}
|
||||
|
||||
export class NotePermissionsDto {
|
||||
@ValidateNested()
|
||||
owner: UserInfoDto;
|
||||
@ValidateNested()
|
||||
@IsArray()
|
||||
sharedTo: NotePermissionEntryDto[];
|
||||
sharedToUsers: NoteUserPermissionEntryDto[];
|
||||
@ValidateNested()
|
||||
@IsArray()
|
||||
sharedToGroups: NoteGroupPermissionEntryDto[];
|
||||
}
|
||||
|
||||
export class NotePermissionsUpdateDto {
|
||||
|
|
Loading…
Reference in a new issue