mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-02 21:15:34 +00:00
disable document form components when no object permissions
This commit is contained in:
1 parent
d15c701510
commit
8b204cac99
18 files changed
+116
-21
No files matched your search
@@ -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