list view: check for readonly based on variant permissions

This commit is contained in:
Mads Rasmussen
2022-05-11 19:26:54 +02:00
parent 16288cf939
commit 95a41afea9
2 changed files with 20 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
(function () {
"use strict";
function ContentAppListViewController($scope) {
var vm = this;
vm.propertyEditorReadonly = propertyEditorReadonly;
function propertyEditorReadonly () {
const allowBrowse = $scope.variantContent.allowedActions.includes('F');
return allowBrowse && $scope.variantContent.allowedActions.length === 1;
}
}
angular.module("umbraco").controller("Umbraco.Editors.Content.Apps.ListViewController", ContentAppListViewController);
})();

View File

@@ -1,10 +1,9 @@
<div>
<div ng-controller="Umbraco.Editors.Content.Apps.ListViewController as vm">
<umb-property ng-repeat="property in model.viewModel track by property.alias" property="property">
<umb-property-editor
model="property"
ng-attr-readonly="{{variantContent.language.culture === 'da-DK' || undefined}}">
<!-- TODO: Update with correct check for readonly -->
ng-attr-readonly="{{ vm.propertyEditorReadonly() || undefined}}">
</umb-property-editor>
</umb-property>