public function isAuthorized($user = null)
    {
        //Any registered user can access public functions
        if (!$this->request->getParam('prefix')) {
            return true;
        }

        //Only admin and managers can access all admin actions
        if ($this->request->isAdmin()) {
            return $this->Auth->isGroup(['admin', 'manager']);
        }

        //Default deny
        return false;
    }
public function isAuthorized($user = null)
    {
        //Any registered user can access public functions
        if (!$this->request->getParam('prefix')) {
            return true;
        }

        //Only admin and managers can access all admin actions
        if ($this->request->isAdmin()) {
            return $this->Auth->isGroup(['admin', 'manager']);
        }

        //Default deny
        return false;
    }
public function isAuthorized ( $ user = null ) { //Any registered user can access public functions if ( ! $ this -> request -> getParam ( 'prefix' ) ) { return true ; } //Only admin and managers can access all admin actions if ( $ this -> request -> isAdmin ( ) ) { return $ this -> Auth -> isGroup ( [ 'admin' , 'manager' ] ) ; } //Default deny return false ; }
Checks if the user is authorized for the request
@param array $user The user to check the authorization of. If empty
the user in the session will be used
@return bool `true` if the user is authorized, otherwise `false`
@uses MeCms\Controller\Component\AuthComponent::isGroup()
Checks if the user is authorized for the request