Skip to content

Commit

Permalink
Fix Publish Forbid issue (#13078)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek committed Jan 13, 2023
1 parent 1cd5e66 commit da1691c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ public async Task<IActionResult> 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();
}
Expand Down Expand Up @@ -534,6 +534,7 @@ public async Task<IActionResult> EditAndPublishPOST(string contentItemId, [Bind(
{
return Forbid();
}

return await EditPOST(contentItemId, returnUrl, stayOnSamePage, async contentItem =>
{
await _contentManager.PublishAsync(contentItem);
Expand Down

0 comments on commit da1691c

Please sign in to comment.