Browse Source

Respect attribute permissions on device and asset profile attributes tab

pull/15356/head
Oleksandra Matviienko 2 months ago
parent
commit
7c63268d27
  1. 17
      ui-ngx/src/app/modules/home/pages/asset-profile/asset-profile-tabs.component.html
  2. 3
      ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html

17
ui-ngx/src/app/modules/home/pages/asset-profile/asset-profile-tabs.component.html

@ -6,13 +6,16 @@
-->
@if (entity && !isEdit) {
<mat-tab label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab">
<tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE"
[active]="attributesTab.isActive"
[entityId]="entity.id"
[entityName]="entity.name">
</tb-attribute-table>
</mat-tab>
@if (resource.ASSET_PROFILE | hasGenericPermission: operation.READ_ATTRIBUTES) {
<mat-tab label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab">
<tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE"
[readonly]="!(resource.ASSET_PROFILE | hasGenericPermission: operation.WRITE_ATTRIBUTES)"
[active]="attributesTab.isActive"
[entityId]="entity.id"
[entityName]="entity.name">
</tb-attribute-table>
</mat-tab>
}
@if (authUser.authority === authorities.TENANT_ADMIN && (resource.ASSET_PROFILE | hasGenericPermission: operation.READ_CALCULATED_FIELD)) {
<mat-tab label="{{ 'entity.type-calculated-fields' | translate }}" #calculatedFieldsTab="matTab">
<tb-calculated-fields-table

3
ui-ngx/src/app/modules/home/pages/device-profile/device-profile-tabs.component.html

@ -6,9 +6,10 @@
-->
@if (entity) {
@if (!isEdit) {
@if (!isEdit && (resource.DEVICE_PROFILE | hasGenericPermission: operation.READ_ATTRIBUTES)) {
<mat-tab label="{{ 'attribute.attributes' | translate }}" #attributesTab="matTab">
<tb-attribute-table [defaultAttributeScope]="attributeScopes.SERVER_SCOPE"
[readonly]="!(resource.DEVICE_PROFILE | hasGenericPermission: operation.WRITE_ATTRIBUTES)"
[active]="attributesTab.isActive"
[entityId]="entity.id"
[entityName]="entity.name">

Loading…
Cancel
Save