mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-17 08:34:54 -04:00
NotePermission DTOs: Add doc comments
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
1a825ed199
commit
eb2544bc2b
1 changed files with 67 additions and 0 deletions
|
@ -8,57 +8,124 @@ import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
|
||||||
import { UserInfoDto } from '../users/user-info.dto';
|
import { UserInfoDto } from '../users/user-info.dto';
|
||||||
|
|
||||||
export class NoteUserPermissionEntryDto {
|
export class NoteUserPermissionEntryDto {
|
||||||
|
/**
|
||||||
|
* User this permission applies to
|
||||||
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
user: UserInfoDto;
|
user: UserInfoDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if the user is allowed to edit the note
|
||||||
|
* @example false
|
||||||
|
*/
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
canEdit: boolean;
|
canEdit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NoteUserPermissionUpdateDto {
|
export class NoteUserPermissionUpdateDto {
|
||||||
|
/**
|
||||||
|
* Username of the user this permission should apply to
|
||||||
|
* @example "john.smith"
|
||||||
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
username: string;
|
username: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if the user should be allowed to edit the note
|
||||||
|
* @example false
|
||||||
|
*/
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
canEdit: boolean;
|
canEdit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class GroupInfoDto {
|
export class GroupInfoDto {
|
||||||
|
/**
|
||||||
|
* Name of the group
|
||||||
|
* @example "superheroes"
|
||||||
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display name of this group
|
||||||
|
* @example "Superheroes"
|
||||||
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if this group must be specially handled
|
||||||
|
* Used for e.g. "everybody", "all logged in users"
|
||||||
|
* @example false
|
||||||
|
*/
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
special: boolean;
|
special: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NoteGroupPermissionEntryDto {
|
export class NoteGroupPermissionEntryDto {
|
||||||
|
/**
|
||||||
|
* Group this permission applies to
|
||||||
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
group: GroupInfoDto;
|
group: GroupInfoDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if the group members are allowed to edit the note
|
||||||
|
* @example false
|
||||||
|
*/
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
canEdit: boolean;
|
canEdit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NoteGroupPermissionUpdateDto {
|
export class NoteGroupPermissionUpdateDto {
|
||||||
|
/**
|
||||||
|
* Name of the group this permission should apply to
|
||||||
|
* @example "superheroes"
|
||||||
|
*/
|
||||||
@IsString()
|
@IsString()
|
||||||
groupname: string;
|
groupname: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if the group members should be allowed to edit the note
|
||||||
|
* @example false
|
||||||
|
*/
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
canEdit: boolean;
|
canEdit: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NotePermissionsDto {
|
export class NotePermissionsDto {
|
||||||
|
/**
|
||||||
|
* User this permission applies to
|
||||||
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
owner: UserInfoDto;
|
owner: UserInfoDto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of users the note is shared with
|
||||||
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
@IsArray()
|
@IsArray()
|
||||||
sharedToUsers: NoteUserPermissionEntryDto[];
|
sharedToUsers: NoteUserPermissionEntryDto[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of groups the note is shared with
|
||||||
|
*/
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
@IsArray()
|
@IsArray()
|
||||||
sharedToGroups: NoteGroupPermissionEntryDto[];
|
sharedToGroups: NoteGroupPermissionEntryDto[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export class NotePermissionsUpdateDto {
|
export class NotePermissionsUpdateDto {
|
||||||
|
/**
|
||||||
|
* List of users the note should be shared with
|
||||||
|
*/
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
sharedToUsers: NoteUserPermissionUpdateDto[];
|
sharedToUsers: NoteUserPermissionUpdateDto[];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of groups the note should be shared with
|
||||||
|
*/
|
||||||
@IsArray()
|
@IsArray()
|
||||||
@ValidateNested()
|
@ValidateNested()
|
||||||
sharedToGroups: NoteGroupPermissionUpdateDto[];
|
sharedToGroups: NoteGroupPermissionUpdateDto[];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue