From d7ddbfec35f3731fef0d2924a0b9560ddbfb8aa7 Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Mon, 19 Mar 2018 18:51:13 -0600 Subject: [PATCH 1/2] U4-11133 - Fix access check for Unpublish button The logic to show the Unpublish button was checking for "Publish" (U) permission rather than "Unpublish" (Z) --- .../src/common/services/contenteditinghelper.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index 6aab9a655c..420e136507 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -246,7 +246,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica //if we are not creating, then we should add unpublish too, // so long as it's already published and if the user has access to publish if (!args.create) { - if (args.content.publishDate && _.contains(args.content.allowedActions, "U")) { + if (args.content.publishDate && _.contains(args.content.allowedActions, "Z")) { buttons.subButtons.push(createButtonDefinition("Z")); } } From 0b63eb9430ecb984311e8001cacde492981649aa Mon Sep 17 00:00:00 2001 From: Tom Fulton Date: Mon, 19 Mar 2018 19:43:07 -0600 Subject: [PATCH 2/2] U4-11133 - Adjust access check for Unpublish button Require both Publish (assigned) and Unpublish (automatic, but could be removed during event) to show the button --- .../src/common/services/contenteditinghelper.service.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js index 420e136507..57f7e09d39 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/contenteditinghelper.service.js @@ -243,10 +243,11 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica } - //if we are not creating, then we should add unpublish too, + // if we are not creating, then we should add unpublish too, // so long as it's already published and if the user has access to publish + // and the user has access to unpublish (may have been removed via Event) if (!args.create) { - if (args.content.publishDate && _.contains(args.content.allowedActions, "Z")) { + if (args.content.publishDate && _.contains(args.content.allowedActions, "U") && _.contains(args.content.allowedActions, "Z")) { buttons.subButtons.push(createButtonDefinition("Z")); } }