From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:44:04 +0000 (-0800) Subject: Fix: dont lose permissions ui if owner changed from null (#5433) X-Git-Tag: v2.4.0~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc1918ad10436bc05f519f588ae60c4b5204763f;p=thirdparty%2Fpaperless-ngx.git Fix: dont lose permissions ui if owner changed from null (#5433) --- 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 0e79b3deb1..798e867bf5 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 ||