1 export type DocumentRoleType =
7 | 'PublicViewerWithAccess'
10 export class DocumentRole {
11 constructor(public readonly roleType: DocumentRoleType) {}
13 public canEdit(): boolean {
14 return this.roleType === 'Editor' || this.roleType === 'Admin' || this.roleType === 'PublicEditor'
18 return this.roleType === 'Admin'
21 canComment(): boolean {
23 this.roleType === 'Commenter' ||
24 this.roleType === 'Editor' ||
25 this.roleType === 'Admin' ||
26 this.roleType === 'PublicEditor'
30 isPublicViewer(): boolean {
31 return this.roleType === 'PublicViewer' || this.roleType === 'PublicViewerWithAccess'
34 isPublicEditor(): boolean {
35 return this.roleType === 'PublicEditor'
38 isPublicViewerWithAccess(): boolean {
39 return this.roleType === 'PublicViewerWithAccess'
42 isPublicViewerOrEditor(): boolean {
43 return this.isPublicViewer() || this.isPublicEditor()