From da1691c60d89866fde55e177656f8d53d278ba64 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Thu, 12 Jan 2023 17:50:15 -0800 Subject: [PATCH] Fix Publish Forbid issue (#13078) --- .../OrchardCore.Contents/Controllers/AdminController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs b/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs index 953807d0a75..2aa2f73fe33 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Controllers/AdminController.cs @@ -406,7 +406,7 @@ public async Task CreateAndPublishPOST(string id, [Bind(Prefix = var stayOnSamePage = submitPublish == "submit.PublishAndContinue"; // Pass a dummy contentitem to the authorization check to check for "own" variations permissions. - if (await _authorizationService.AuthorizeContentTypeAsync(User, CommonPermissions.PublishContent, id, CurrentUserId())) + if (!await _authorizationService.AuthorizeContentTypeAsync(User, CommonPermissions.PublishContent, id, CurrentUserId())) { return Forbid(); } @@ -534,6 +534,7 @@ public async Task EditAndPublishPOST(string contentItemId, [Bind( { return Forbid(); } + return await EditPOST(contentItemId, returnUrl, stayOnSamePage, async contentItem => { await _contentManager.PublishAsync(contentItem);