From d86e1bd50a598e6d3876b7001f1332afc1ece1d9 Mon Sep 17 00:00:00 2001 From: Nattfarinn Date: Thu, 8 Mar 2018 14:21:06 +0100 Subject: [PATCH] fix: Make sure user has Publish permission as well --- src/bundle/Controller/ContentController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/bundle/Controller/ContentController.php b/src/bundle/Controller/ContentController.php index 48f0066e9d..52658be0cb 100644 --- a/src/bundle/Controller/ContentController.php +++ b/src/bundle/Controller/ContentController.php @@ -216,6 +216,18 @@ public function hasOnTheFlyCreateAccessAction(Request $request, string $language ); } + if (!$permissionResolver->canUser('content', 'publish', $contentCreateStruct, [$locationCreateStruct])) { + throw new UnauthorizedException( + 'content', + 'publish', + [ + 'contentTypeIdentifier' => $contentType->identifier, + 'parentLocationId' => $locationCreateStruct->parentLocationId, + 'languageCode' => $languageCode, + ] + ); + } + $response->setData([ 'access' => true, ]);