Newscoop\Services\BlogService::isAllowed PHP Method

isAllowed() public method

Test if blogger is allowed to perform action
public isAllowed ( Zend_Controller_Request_Abstract $request, User $user = null ) : boolean
$request Zend_Controller_Request_Abstract
$user Newscoop\Entity\User
return boolean
    public function isAllowed(\Zend_Controller_Request_Abstract $request, User $user = null)
    {
        if (in_array($request->getControllerName(), array('blog', 'auth', 'image', 'slideshow', 'media'))) {
            return TRUE;
        }
        if ($request->isXmlHttpRequest()) {
            return TRUE;
        }
        if ($request->getParam('controller') == 'ad.php') {
            return TRUE;
        }
        if ($request->isPost() && $request->getParam('controller') == 'articles' && in_array($request->getParam('action'), $this->postArticleActions)) {
            if ($this->isRequestedArticleEditable($request, $user)) {
                return TRUE;
            }
        }
        if ($request->isGet() && $request->getParam('controller') == 'articles' && in_array($request->getParam('action'), $this->getArticleActions) && isset($user)) {
            if ($this->isRequestedArticleEditable($request, $user)) {
                return TRUE;
            }
        }
        return FALSE;
    }