only allow change of doc type if you have access to the settings section

This commit is contained in:
Mads Rasmussen
2018-06-27 20:06:24 +02:00
parent 68f4aae172
commit f058ec9c03
2 changed files with 13 additions and 5 deletions

View File

@@ -11,9 +11,19 @@
scope.publishStatus = {};
scope.disableTemplates = Umbraco.Sys.ServerVariables.features.disabledFeatures.disableTemplates;
scope.allowChangeDocumentType = false;
function onInit() {
userService.getCurrentUser().then(function(user){
// only allow change of media type if user has access to the settings sections
angular.forEach(user.sections, function(section){
if(section.alias === "settings") {
scope.allowChangeDocumentType = true;
}
});
});
var keys = [
"general_deleted",
"content_unpublished",
@@ -32,8 +42,6 @@
});
scope.allowOpen = true;
scope.datePickerConfig = {
pickDate: true,
pickTime: true,

View File

@@ -179,9 +179,9 @@
<umb-control-group data-element="node-info-document-type" label="@content_documentType">
<umb-node-preview style="max-width: 100%; margin-bottom: 0;"
icon="documentType.icon"
name="documentType.name"
allow-open="allowOpen"
icon="node.icon"
name="node.contentTypeName"
allow-open="allowChangeDocumentType"
on-open="openDocumentType(documentType)">
</umb-node-preview>
</umb-control-group>