public function deleteCommentAction(Request $request, Blog $blog, Comment $comment, User $user)
    {
        //original author or admin can edit, anon cant edit
        if ($blog->isCommentsAuthorized() && $this->isLoggedIn($user)) {
            if ($user === $comment->getAuthor()
                || $this->checkPermission('EDIT', $blog->getResourceNode())
                || $this->checkPermission('MODERATE', $blog->getResourceNode())) {
                $commentId = $this->commentManager->deleteComment($blog, $comment);

                return new JsonResponse($commentId);
            } else {
                throw new AccessDeniedException();
            }
        } else {
            throw new AccessDeniedException();
        }
    }
public function deleteCommentAction(Request $request, Blog $blog, Comment $comment, User $user)
    {
        //original author or admin can edit, anon cant edit
        if ($blog->isCommentsAuthorized() && $this->isLoggedIn($user)) {
            if ($user === $comment->getAuthor()
                || $this->checkPermission('EDIT', $blog->getResourceNode())
                || $this->checkPermission('MODERATE', $blog->getResourceNode())) {
                $commentId = $this->commentManager->deleteComment($blog, $comment);

                return new JsonResponse($commentId);
            } else {
                throw new AccessDeniedException();
            }
        } else {
            throw new AccessDeniedException();
        }
    }
public function deleteCommentAction ( Request $ request , Blog $ blog , Comment $ comment , User $ user ) { //original author or admin can edit, anon cant edit if ( $ blog -> isCommentsAuthorized ( ) && $ this -> isLoggedIn ( $ user ) ) { if ( $ user === $ comment -> getAuthor ( ) || $ this -> checkPermission ( 'EDIT' , $ blog -> getResourceNode ( ) ) || $ this -> checkPermission ( 'MODERATE' , $ blog -> getResourceNode ( ) ) ) { $ commentId = $ this -> commentManager -> deleteComment ( $ blog , $ comment ) ; return new JsonResponse ( $ commentId ) ; } else { throw new AccessDeniedException ( ) ; } } else { throw new AccessDeniedException ( ) ; } }
Delete post comment.

@EXT\Route("/{commentId}/delete", name="apiv2_blog_comment_delete")
@EXT\Method("DELETE")
@EXT\ParamConverter("comment", class="IcapBlogBundle:Comment", options={"mapping": {"commentId": "uuid"}})
@EXT\ParamConverter("user", converter="current_user", options={"allowAnonymous"=false})

@param Blog    $blog
@param Comment $comment
@param User    $user

@return array
Delete post comment .