mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Fix: disable inline create buttons if insufficient permissions (#7401)
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user