mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
disable document form components when no object permissions
This commit is contained in:
@@ -306,6 +306,7 @@ export class DocumentDetailComponent
|
||||
.map((p) => p[0]),
|
||||
}
|
||||
this.documentForm.patchValue(doc)
|
||||
if (!this.userCanEdit) this.documentForm.disable()
|
||||
}
|
||||
|
||||
createDocumentType(newName: string) {
|
||||
@@ -591,4 +592,14 @@ export class DocumentDetailComponent
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
get userCanEdit(): boolean {
|
||||
return (
|
||||
!this.document ||
|
||||
this.permissionsService.currentUserHasObjectPermissions(
|
||||
PermissionAction.Change,
|
||||
this.document
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user