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 e140c09bb6..7f9d05aebc 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 @@ -12,16 +12,10 @@ scope.disableTemplates = Umbraco.Sys.ServerVariables.features.disabledFeatures.disableTemplates; function onInit() { - - // By default don't show the open anchors - scope.allowOpen = false; - - // If logged in as an admin user show the open anchors - userService.getCurrentUser().then(function (currentUser) { - if(currentUser.userType === "admin"){ - scope.allowOpen = true; - } - }); + // If logged in user has access to the settings section + // show the open anchors - if the user doesn't have + // access, documentType is null, see ContentModelMapper + scope.allowOpen = scope.node.documentType !== null; scope.datePickerConfig = { pickDate: true, @@ -53,7 +47,9 @@ setNodePublishStatus(scope.node); // Declare a fallback URL for the directive - scope.previewOpenUrl = '#/settings/documenttypes/edit/' + scope.documentType.id; + if (scope.documentType !== null) { + scope.previewOpenUrl = '#/settings/documenttypes/edit/' + scope.documentType.id; + } } scope.auditTrailPageChange = function (pageNumber) { diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js index 1af3257eb4..efdeceb78f 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/media/umbmedianodeinfo.directive.js @@ -8,20 +8,14 @@ var evts = []; function onInit() { - // By default don't show the open anchors - scope.allowOpenMediaType = false; - - // If logged in as an admin user show the open anchors - userService.getCurrentUser().then(function (currentUser) { - if(currentUser.userType === "admin"){ - scope.allowOpenMediaType = true; - } - }); - + // If logged in user has access to the settings section + // show the open anchors - if the user doesn't have + // access, contentType is null, see MediaModelMapper + scope.allowOpen = scope.node.contentType !== null; + // get document type details scope.mediaType = scope.node.contentType; - // get node url - scope.nodeUrl = scope.node.mediaLink; + // set the media link initially setMediaLink(); // make sure dates are formatted to the user's locale diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html index 13cf3655b6..8584b30177 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/umb-content-node-info.html @@ -179,7 +179,7 @@ diff --git a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html index 9f51281850..19095acb90 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/media/umb-media-node-info.html @@ -41,8 +41,8 @@