From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:31:24 +0000 (-0700) Subject: Fix: document link field consistent behavior with insufficient permissions (#7953) X-Git-Tag: v2.13.1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0ad073bb2e3a8c7c68d72fc8518a19e577365d9;p=thirdparty%2Fpaperless-ngx.git Fix: document link field consistent behavior with insufficient permissions (#7953) --- diff --git a/src-ui/src/app/components/common/input/document-link/document-link.component.html b/src-ui/src/app/components/common/input/document-link/document-link.component.html index 94f4f21b49..70b6d82639 100644 --- a/src-ui/src/app/components/common/input/document-link/document-link.component.html +++ b/src-ui/src/app/components/common/input/document-link/document-link.component.html @@ -40,7 +40,7 @@ (change)="onChange(selectedDocuments)">
- +  {{document.title}} diff --git a/src-ui/src/app/components/common/input/document-link/document-link.component.scss b/src-ui/src/app/components/common/input/document-link/document-link.component.scss index 5541def31f..1c83a71227 100644 --- a/src-ui/src/app/components/common/input/document-link/document-link.component.scss +++ b/src-ui/src/app/components/common/input/document-link/document-link.component.scss @@ -3,7 +3,19 @@ .ng-value { background-color: transparent !important; - border-color: transparent; + border-color: transparent !important; + } +} + +.paperless-input-select.disabled { + --bs-btn-disabled-border-color: transparent; + ::ng-deep ng-select { + .ng-select-container { + div, .ng-arrow-wrapper, input { + cursor: not-allowed; + } + background-color: var(--pngx-bg-alt) !important; + } } } diff --git a/src-ui/src/app/components/document-detail/document-detail.component.html b/src-ui/src/app/components/document-detail/document-detail.component.html index e44d7a7131..25a512463a 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.html +++ b/src-ui/src/app/components/document-detail/document-detail.component.html @@ -344,8 +344,8 @@ @if (!hasNext()) { } + -
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 084efefe7e..6cd26b3685 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 @@ -1020,10 +1020,14 @@ export class DocumentDetailComponent } return ( !this.document || - this.permissionsService.currentUserHasObjectPermissions( + (this.permissionsService.currentUserCan( PermissionAction.Change, - doc - ) + PermissionType.Document + ) && + this.permissionsService.currentUserHasObjectPermissions( + PermissionAction.Change, + doc + )) ) }