From: shamoon <4887959+shamoon@users.noreply.github.com>
Date: Sun, 9 Apr 2023 23:17:48 +0000 (-0700)
Subject: Hide Permissions if user cannot view users
X-Git-Tag: v1.14.0~1^2~15^2
X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3061%2Fhead;p=thirdparty%2Fpaperless-ngx.git
Hide Permissions if user cannot view users
---
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 cad0f715af..71092fe723 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
@@ -178,7 +178,7 @@
-
+
Permissions
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 d9e813c6a0..6d03ec0248 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
@@ -688,12 +688,21 @@ export class DocumentDetailComponent
}
}
+ get showPermissions(): boolean {
+ return (
+ this.permissionsService.currentUserCan(
+ PermissionAction.View,
+ PermissionType.User
+ ) && this.userIsOwner
+ )
+ }
+
get notesEnabled(): boolean {
return (
this.settings.get(SETTINGS_KEYS.NOTES_ENABLED) &&
this.permissionsService.currentUserCan(
PermissionAction.View,
- PermissionType.Document
+ PermissionType.Note
)
)
}