From abb4ab6b0aba36d1ab2cacf5215afab610c86586 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 18 Dec 2018 21:56:06 +0100 Subject: [PATCH] fix open template/open doctype buttons --- .../content/umbcontentnodeinfo.directive.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js index 31e847f0f6..5da37ff64e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js @@ -21,14 +21,11 @@ scope.isInfiniteMode = editorService.getNumberOfEditors() > 0 ? true : false; 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.isInfiniteMode) { - scope.allowChangeDocumentType = true; - scope.allowChangeTemplate = true; - } - }); - }); + // only allow change of media type if user has access to the settings sections + const hasAccessToSettings = user.allowedSections.indexOf("settings") !== -1 ? true : false; + scope.allowChangeDocumentType = hasAccessToSettings; + scope.allowChangeTemplate = hasAccessToSettings; + }); var keys = [ "general_deleted",