Skip to content

Commit

Permalink
use Controller utility isGranted()
Browse files Browse the repository at this point in the history
  • Loading branch information
alsciende committed Sep 14, 2018
1 parent bdedb37 commit 596098a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/AppBundle/Controller/SocialController.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,11 @@ public function commentAction(Request $request, EntityManagerInterface $entityMa
*
* @ParamConverter("comment", class="AppBundle:Comment", options={"id" = "comment_id"})
*/
public function hidecommentAction(Comment $comment, int $hidden, EntityManagerInterface $entityManager, AuthorizationCheckerInterface $authorizationChecker)
public function hidecommentAction(Comment $comment, int $hidden, EntityManagerInterface $entityManager)
{
$user = $this->getUser();

if ($comment->getDecklist()->getUser()->getId() !== $user->getId() && !$authorizationChecker->isGranted('ROLE_MODERATOR')) {
if ($comment->getDecklist()->getUser()->getId() !== $user->getId() && !$this->isGranted('ROLE_MODERATOR')) {
throw $this->createAccessDeniedException();
}

Expand Down

0 comments on commit 596098a

Please sign in to comment.