mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Fix: document link field consistent behavior with insufficient permissions (#7953)
This commit is contained in:
parent
de95b296a0
commit
f0ad073bb2
@ -40,7 +40,7 @@
|
|||||||
(change)="onChange(selectedDocuments)">
|
(change)="onChange(selectedDocuments)">
|
||||||
<ng-template ng-label-tmp let-document="item">
|
<ng-template ng-label-tmp let-document="item">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<button class="btn p-0 lh-1" (click)="unselect(document)" title="Remove link" i18n-title><i-bs name="x"></i-bs></button>
|
<button class="btn p-0 lh-1" [disabled]="disabled" (click)="unselect(document)" title="Remove link" i18n-title><i-bs name="x"></i-bs></button>
|
||||||
<a routerLink="/documents/{{document.id}}" class="badge bg-light text-primary" (mousedown)="$event.stopImmediatePropagation();" title="Open link" i18n-title>
|
<a routerLink="/documents/{{document.id}}" class="badge bg-light text-primary" (mousedown)="$event.stopImmediatePropagation();" title="Open link" i18n-title>
|
||||||
<i-bs width="0.9em" height="0.9em" name="file-text"></i-bs> <span>{{document.title}}</span>
|
<i-bs width="0.9em" height="0.9em" name="file-text"></i-bs> <span>{{document.title}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -3,7 +3,19 @@
|
|||||||
|
|
||||||
.ng-value {
|
.ng-value {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
border-color: transparent;
|
border-color: transparent !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.paperless-input-select.disabled {
|
||||||
|
--bs-btn-disabled-border-color: transparent;
|
||||||
|
::ng-deep ng-select {
|
||||||
|
.ng-select-container {
|
||||||
|
div, .ng-arrow-wrapper, input {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
background-color: var(--pngx-bg-alt) !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,8 +344,8 @@
|
|||||||
@if (!hasNext()) {
|
@if (!hasNext()) {
|
||||||
<button type="button" class="order-2 btn btn-sm btn-outline-primary" (click)="save(true)" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Save & close</button>
|
<button type="button" class="order-2 btn btn-sm btn-outline-primary" (click)="save(true)" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Save & close</button>
|
||||||
}
|
}
|
||||||
|
<button type="button" class="order-0 btn btn-sm btn-outline-secondary" (click)="discard()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Discard</button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<button type="button" class="order-0 btn btn-sm btn-outline-secondary" (click)="discard()" i18n [disabled]="!userCanEdit || networkActive || (isDirty$ | async) !== true">Discard</button>
|
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
@ -1020,10 +1020,14 @@ export class DocumentDetailComponent
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
!this.document ||
|
!this.document ||
|
||||||
this.permissionsService.currentUserHasObjectPermissions(
|
(this.permissionsService.currentUserCan(
|
||||||
PermissionAction.Change,
|
PermissionAction.Change,
|
||||||
doc
|
PermissionType.Document
|
||||||
)
|
) &&
|
||||||
|
this.permissionsService.currentUserHasObjectPermissions(
|
||||||
|
PermissionAction.Change,
|
||||||
|
doc
|
||||||
|
))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user