From e75510309da9546cd51f099e7138ca6bff80ec58 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 9 Apr 2023 16:17:48 -0700 Subject: [PATCH] Hide Permissions if user cannot view users --- .../document-detail/document-detail.component.html | 2 +- .../document-detail/document-detail.component.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) 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 cad0f715a..71092fe72 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 d9e813c6a..6d03ec024 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 ) ) }