content: check for readonly properties based on variant permissions

This commit is contained in:
Mads Rasmussen
2022-05-11 19:26:24 +02:00
parent 1810b7a744
commit 16288cf939
2 changed files with 7 additions and 4 deletions

View File

@@ -182,6 +182,11 @@
}
);
$scope.propertyEditorReadonly = function(property) {
const allowBrowse = $scope.content.allowedActions.includes('F');
return allowBrowse && $scope.content.allowedActions.length === 1;
};
$scope.propertyEditorDisabled = function (property) {
if (property.unlockInvariantValue) {
return false;

View File

@@ -18,8 +18,7 @@
<umb-property-editor
model="property"
preview="propertyEditorDisabled(property)"
ng-attr-readonly="{{content.language.culture === 'da-DK' || undefined}}">
<!-- TODO: Update with correct check for readonly -->
ng-attr-readonly="{{propertyEditorReadonly(property) || undefined}}">
</umb-property-editor>
</div>
</umb-property>
@@ -50,8 +49,7 @@
<umb-property-editor
model="property"
preview="propertyEditorDisabled(property)"
ng-attr-readonly="{{content.language.culture === 'da-DK' || undefined}}">
<!--TODO: Update with correct check for readonly -->
ng-attr-readonly="{{propertyEditorReadonly(property) || undefined}}">
</umb-property-editor>
</div>