list view: check for readonly based on variant permissions
This commit is contained in:
@@ -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);
|
||||
})();
|
||||
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user