mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
Fix: disable inline create buttons if insufficient permissions (#7401)
This commit is contained in:
parent
9cca7aaa08
commit
928580bf4f
7 changed files with 81 additions and 41 deletions
|
|
@ -651,6 +651,31 @@ export class DocumentDetailComponent
|
|||
})
|
||||
}
|
||||
|
||||
createDisabled(dataType: DataType) {
|
||||
switch (dataType) {
|
||||
case DataType.Correspondent:
|
||||
return !this.permissionsService.currentUserCan(
|
||||
PermissionAction.Add,
|
||||
PermissionType.Correspondent
|
||||
)
|
||||
case DataType.DocumentType:
|
||||
return !this.permissionsService.currentUserCan(
|
||||
PermissionAction.Add,
|
||||
PermissionType.DocumentType
|
||||
)
|
||||
case DataType.StoragePath:
|
||||
return !this.permissionsService.currentUserCan(
|
||||
PermissionAction.Add,
|
||||
PermissionType.StoragePath
|
||||
)
|
||||
case DataType.Tag:
|
||||
return !this.permissionsService.currentUserCan(
|
||||
PermissionAction.Add,
|
||||
PermissionType.Tag
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
discard() {
|
||||
this.documentsService
|
||||
.get(this.documentId)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue