]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
fix unable to change owner to someone else
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 3 Mar 2023 23:52:28 +0000 (15:52 -0800)
committershamoon <4887959+shamoon@users.noreply.github.com>
Mon, 20 Mar 2023 06:39:52 +0000 (23:39 -0700)
src-ui/src/app/components/document-detail/document-detail.component.ts

index e154cd03bfc948827d44a6d1cbc54e3f1a84e7df..2038bd41e328a2bfd819422f5e4a3720ea48ff39 100644 (file)
@@ -676,8 +676,8 @@ export class DocumentDetailComponent
   get userIsOwner(): boolean {
     let doc: PaperlessDocument = Object.assign({}, this.document)
     // dont disable while editing
-    if (this.document && this.store?.value.owner) {
-      doc.owner = this.store?.value.owner
+    if (this.document && this.store?.value.permissions_form?.owner) {
+      doc.owner = this.store?.value.permissions_form?.owner
     }
     return !this.document || this.permissionsService.currentUserOwnsObject(doc)
   }
@@ -685,8 +685,8 @@ export class DocumentDetailComponent
   get userCanEdit(): boolean {
     let doc: PaperlessDocument = Object.assign({}, this.document)
     // dont disable while editing
-    if (this.document && this.store?.value.owner) {
-      doc.owner = this.store?.value.owner
+    if (this.document && this.store?.value.permissions_form?.owner) {
+      doc.owner = this.store?.value.permissions_form?.owner
     }
     return (
       !this.document ||