mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-17 20:16:32 +01:00
Refactor permissions check code
Directly check permissions and no subscription (uisettings is always initialized on frontend startup) update permission directive to accept single string add explicit management permission name
This commit is contained in:
parent
4603813896
commit
59e359ff98
25 changed files with 74 additions and 125 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<div *ngIf="comments">
|
||||
<form [formGroup]="commentForm" class="needs-validation mt-3" *ifPermissions='["documents.add_comment"]' novalidate>
|
||||
<form [formGroup]="commentForm" class="needs-validation mt-3" *ifPermissions="'documents.add_comment'" novalidate>
|
||||
<div class="form-group">
|
||||
<textarea class="form-control form-control-sm" [class.is-invalid]="newCommentError" rows="3" formControlName="newComment" placeholder="Enter comment" i18n-placeholder required></textarea>
|
||||
<div class="invalid-feedback" i18n>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<div class="d-flex card-footer small bg-light text-primary justify-content-between align-items-center">
|
||||
<span>{{displayName(comment)}} - {{ comment.created | customDate}}</span>
|
||||
<button type="button" class="btn btn-link btn-sm p-0 fade" (click)="deleteComment(comment.id)" *ifPermissions='["documents.delete_comment"]'>
|
||||
<button type="button" class="btn btn-link btn-sm p-0 fade" (click)="deleteComment(comment.id)" *ifPermissions="'documents.delete_comment'">
|
||||
<svg width="13" height="13" fill="currentColor">
|
||||
<use xlink:href="assets/bootstrap-icons.svg#trash" />
|
||||
</svg>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue