Merge remote-tracking branch 'origin/v10/feature/variant-permissions' into v10/feature/variant-permissions

This commit is contained in:
Nikolaj Geisle
2022-05-16 14:00:22 +02:00
2 changed files with 16 additions and 16 deletions

View File

@@ -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>

View File

@@ -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;
}