]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Hide selects when user doesnt have view permissions
authorshamoon <4887959+shamoon@users.noreply.github.com>
Mon, 6 Mar 2023 19:07:40 +0000 (11:07 -0800)
committershamoon <4887959+shamoon@users.noreply.github.com>
Mon, 6 Mar 2023 19:07:40 +0000 (11:07 -0800)
[ci skip]

src-ui/src/app/components/document-detail/document-detail.component.html

index 5501e8ae7f00a95f96b14e6d475cfe1a4fd42e7a..3459ce2ae40c1a1037ab41bcf78f10508710b1d3 100644 (file)
                         <app-input-date i18n-title title="Date created" formControlName="created_date" [suggestions]="suggestions?.dates"
                             [error]="error?.created_date"></app-input-date>
                         <app-input-select [items]="correspondents" i18n-title title="Correspondent" formControlName="correspondent" [allowNull]="true"
-                            (createNew)="createCorrespondent($event)" [suggestions]="suggestions?.correspondents"></app-input-select>
+                            (createNew)="createCorrespondent($event)" [suggestions]="suggestions?.correspondents" *appIfPermissions="{ action: PermissionAction.View, type: PermissionType.Correspondent }"></app-input-select>
                         <app-input-select [items]="documentTypes" i18n-title title="Document type" formControlName="document_type" [allowNull]="true"
-                            (createNew)="createDocumentType($event)" [suggestions]="suggestions?.document_types"></app-input-select>
+                            (createNew)="createDocumentType($event)" [suggestions]="suggestions?.document_types" *appIfPermissions="{ action: PermissionAction.View, type: PermissionType.DocumentType }"></app-input-select>
                         <app-input-select [items]="storagePaths" i18n-title title="Storage path" formControlName="storage_path" [allowNull]="true"
-                            (createNew)="createStoragePath($event)" [suggestions]="suggestions?.storage_paths" i18n-placeholder placeholder="Default"></app-input-select>
-                        <app-input-tags formControlName="tags" [suggestions]="suggestions?.tags"></app-input-tags>
+                            (createNew)="createStoragePath($event)" [suggestions]="suggestions?.storage_paths" i18n-placeholder placeholder="Default" *appIfPermissions="{ action: PermissionAction.View, type: PermissionType.StoragePath }"></app-input-select>
+                        <app-input-tags formControlName="tags" [suggestions]="suggestions?.tags" *appIfPermissions="{ action: PermissionAction.View, type: PermissionType.Tag }"></app-input-tags>
 
                     </ng-template>
                 </li>