public function canExecute($action)
    {
        if ($this->getItem() && $this->getItem()->blocking(get_viewer())) {
            return false;
        }

        //if the action is an admin action then check if the viewer is an admin
        if ($this->isAdministrable()) {
            $methods = $this->getBehavior('administrable')->getMethods();

            if (in_array('_action'.ucfirst($action), $methods) && $this->canAdminister() === false) {
                return false;
            }
        }

        return parent::canExecute($action);
    }
public function canExecute($action)
    {
        if ($this->getItem() && $this->getItem()->blocking(get_viewer())) {
            return false;
        }

        //if the action is an admin action then check if the viewer is an admin
        if ($this->isAdministrable()) {
            $methods = $this->getBehavior('administrable')->getMethods();

            if (in_array('_action'.ucfirst($action), $methods) && $this->canAdminister() === false) {
                return false;
            }
        }

        return parent::canExecute($action);
    }
public function canExecute ( $ action ) { if ( $ this -> getItem ( ) && $ this -> getItem ( ) -> blocking ( get_viewer ( ) ) ) { return false ; } //if the action is an admin action then check if the viewer is an admin if ( $ this -> isAdministrable ( ) ) { $ methods = $ this -> getBehavior ( 'administrable' ) -> getMethods ( ) ; if ( in_array ( '_action' . ucfirst ( $ action ) , $ methods ) && $ this -> canAdminister ( ) === false ) { return false ; } } return parent :: canExecute ( $ action ) ; }
If the viewer has been blocked by an actor then don't bring up the actor.

@param string $action The action

@return bool
If the viewer has been blocked by an actor then don t bring up the actor .