]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix: completely hide upload widget if user does not have permissions (#4198)
authorMarwan Khalil <79726688+nawramm@users.noreply.github.com>
Sun, 17 Sep 2023 14:53:20 +0000 (02:53 +1200)
committerGitHub <noreply@github.com>
Sun, 17 Sep 2023 14:53:20 +0000 (14:53 +0000)
src-ui/src/app/components/dashboard/widgets/upload-file-widget/upload-file-widget.component.html

index 30dbdd8e126e4ee68ca16452cd734176f15647eb..af1dd533b99b7d77f152f08ed7b5772ac3018b11 100644 (file)
@@ -1,4 +1,4 @@
-<pngx-widget-frame title="Upload new documents" i18n-title>
+<pngx-widget-frame title="Upload new documents" i18n-title *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.Document }">
   <div header-buttons>
     <a *ngIf="getStatusSuccess().length > 0" (click)="dismissCompleted()" [routerLink]="[]" >
       <span class="me-1" i18n="This button dismisses all status messages about processed documents on the dashboard (failed and successful)">Dismiss completed</span>
@@ -9,7 +9,7 @@
     </a>
   </div>
   <div content tourAnchor="tour.upload-widget">
-    <form *pngxIfPermissions="{ action: PermissionAction.Add, type: PermissionType.Document }">
+    <form>
       <ngx-file-drop dropZoneLabel="Drop documents here or" browseBtnLabel="Browse files" (onFileDrop)="dropped($event)"
         (onFileOver)="fileOver($event)" (onFileLeave)="fileLeave($event)" dropZoneClassName="bg-light card"
         multiple="true" contentClassName="justify-content-center d-flex align-items-center py-5 px-2" [showBrowseBtn]=true