plugin/blog/Controller/API/PostController.php
public function listUnpublishedAction(Request $request, Blog $blog)
    {
        $this->checkPermission('OPEN', $blog->getResourceNode(), [], true);
        if ($this->checkPermission('MODERATE', $blog->getResourceNode())
            || $this->checkPermission('EDIT', $blog->getResourceNode())) {
            $parameters = $request->query->all();

            //if no edit rights, list only published posts
            $posts = $this->postManager->getPosts(
                $blog->getId(),
                $parameters,
                PostManager::GET_UNPUBLISHED_POSTS,
                true);

            return new JsonResponse($posts);
        } else {
            throw new AccessDeniedException();
        }
    }
public function listUnpublishedAction(Request $request, Blog $blog)
    {
        $this->checkPermission('OPEN', $blog->getResourceNode(), [], true);
        if ($this->checkPermission('MODERATE', $blog->getResourceNode())
            || $this->checkPermission('EDIT', $blog->getResourceNode())) {
            $parameters = $request->query->all();

            //if no edit rights, list only published posts
            $posts = $this->postManager->getPosts(
                $blog->getId(),
                $parameters,
                PostManager::GET_UNPUBLISHED_POSTS,
                true);

            return new JsonResponse($posts);
        } else {
            throw new AccessDeniedException();
        }
    }
public function listUnpublishedAction ( Request $ request , Blog $ blog ) { $ this -> checkPermission ( 'OPEN' , $ blog -> getResourceNode ( ) , [ ] , true ) ; if ( $ this -> checkPermission ( 'MODERATE' , $ blog -> getResourceNode ( ) ) || $ this -> checkPermission ( 'EDIT' , $ blog -> getResourceNode ( ) ) ) { $ parameters = $ request -> query -> all ( ) ; //if no edit rights, list only published posts $ posts = $ this -> postManager -> getPosts ( $ blog -> getId ( ) , $ parameters , PostManager :: GET_UNPUBLISHED_POSTS , true ) ; return new JsonResponse ( $ posts ) ; } else { throw new AccessDeniedException ( ) ; } }
Get unpublished blog posts.

@EXT\Route("/moderation", name="apiv2_blog_post_list_unpublished")
@EXT\Method("GET")

@param Blog $blog

@return array
Get unpublished blog posts .