check for permissions in block list editor
This commit is contained in:
@@ -15,14 +15,11 @@
|
||||
show-inherit="vm.model.variants.length > 1 && !property.culture && !activeVariant.language.isDefault"
|
||||
inherits-from="defaultVariant.language.name">
|
||||
|
||||
<div ng-class="{'o-40 cursor-not-allowed': vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue}">
|
||||
<umb-property-editor
|
||||
model="property"
|
||||
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue"
|
||||
ng-attr-readonly="{{vm.model.language.culture === 'da-DK' || undefined}}">
|
||||
<!-- TODO: Update with correct check for readonly -->
|
||||
</umb-property-editor>
|
||||
</div>
|
||||
<umb-property-editor
|
||||
model="property"
|
||||
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue"
|
||||
ng-attr-readonly="{{!vm.allowUpdate || undefined}}">
|
||||
</umb-property-editor>
|
||||
|
||||
</umb-property>
|
||||
</umb-box-content>
|
||||
@@ -47,14 +44,11 @@
|
||||
show-inherit="vm.model.variants.length > 1 && !property.culture && !activeVariant.language.isDefault"
|
||||
inherits-from="defaultVariant.language.name">
|
||||
|
||||
<div ng-class="{'o-40 cursor-not-allowed': vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue}">
|
||||
<umb-property-editor
|
||||
model="property"
|
||||
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue"
|
||||
ng-attr-readonly="{{vm.model.language.culture === 'da-DK' || undefined}}">
|
||||
<!-- TODO: Update with correct check for readonly -->
|
||||
</umb-property-editor>
|
||||
</div>
|
||||
<umb-property-editor
|
||||
model="property"
|
||||
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue"
|
||||
ng-attr-readonly="{{!vm.allowUpdate || undefined}}">
|
||||
</umb-property-editor>
|
||||
|
||||
</umb-property>
|
||||
</div>
|
||||
|
||||
@@ -42,6 +42,12 @@
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watchCollection('vm.model.variants', (newValue) => {
|
||||
if (newValue && newValue.length > 0) {
|
||||
vm.allowUpdate = newValue[0].allowedActions.includes('A');
|
||||
}
|
||||
});
|
||||
|
||||
function getScope() {
|
||||
return $scope;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user