Skip to content

Commit

Permalink
fix: Make sure user has Publish permission as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Mar 8, 2018
1 parent 80c792e commit d86e1bd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bundle/Controller/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
Expand Down

0 comments on commit d86e1bd

Please sign in to comment.