Bolt\Controller\Base::isAllowed PHP Method

isAllowed() protected method

Shortcut for {@see \Bolt\AccessControl\Permissions::isAllowed}
protected isAllowed ( string $what, mixed $user = null, string | null $contenttype = null, integer | null $contentid = null ) : boolean
$what string
$user mixed The user to check permissions against.
$contenttype string | null
$contentid integer | null
return boolean
    protected function isAllowed($what, $user = null, $contenttype = null, $contentid = null)
    {
        /** @var Token $sessionAuth */
        if ($user === null && ($sessionAuth = $this->session()->get('authentication'))) {
            $user = $sessionAuth->getUser()->toArray();
        }
        return $this->app['permissions']->isAllowed($what, $user, $contenttype, $contentid);
    }