Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Fix: dont lose permissions ui if owner changed from null (#5433)

shamoondc1918ad1043
diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts
index 0e79b3deb..798e867bf 100644
--- a/src-ui/src/app/components/document-detail/document-detail.component.ts
+++ b/src-ui/src/app/components/document-detail/document-detail.component.ts
@@ -861,8 +861,11 @@ export class DocumentDetailComponent
get userIsOwner(): boolean {
let doc: Document = Object.assign({}, this.document)
// dont disable while editing
- if (this.document && this.store?.value.permissions_form?.owner) {
- doc.owner = this.store?.value.permissions_form?.owner
+ if (
+ this.document &&
+ this.store?.value.permissions_form?.hasOwnProperty('owner')
+ ) {
+ doc.owner = this.store.value.permissions_form.owner
}
return !this.document || this.permissionsService.currentUserOwnsObject(doc)
}
@@ -870,8 +873,11 @@ export class DocumentDetailComponent
get userCanEdit(): boolean {
let doc: Document = Object.assign({}, this.document)
// dont disable while editing
- if (this.document && this.store?.value.permissions_form?.owner) {
- doc.owner = this.store?.value.permissions_form?.owner
+ if (
+ this.document &&
+ this.store?.value.permissions_form?.hasOwnProperty('owner')
+ ) {
+ doc.owner = this.store.value.permissions_form.owner
}
return (
!this.document ||