protected function _authorizeLead(AnCommandContext $context)
    {
        //obviously guests cannot add new followers
        if (is_guest($this->_viewer)) {
            return false;
        }

        //viewers cannot add new followers to themselves
        if ($this->_viewer->eql($this->_entity)) {
            return false;
        }

        //new followers cannot be added to people
        if (is_person($this->_entity)) {
            return false;
        }

        return $this->_entity->authorize('action', 'leadable:add');
    }
protected function _authorizeLead(AnCommandContext $context)
    {
        //obviously guests cannot add new followers
        if (is_guest($this->_viewer)) {
            return false;
        }

        //viewers cannot add new followers to themselves
        if ($this->_viewer->eql($this->_entity)) {
            return false;
        }

        //new followers cannot be added to people
        if (is_person($this->_entity)) {
            return false;
        }

        return $this->_entity->authorize('action', 'leadable:add');
    }
protected function _authorizeLead ( AnCommandContext $ context ) { //obviously guests cannot add new followers if ( is_guest ( $ this -> _viewer ) ) { return false ; } //viewers cannot add new followers to themselves if ( $ this -> _viewer -> eql ( $ this -> _entity ) ) { return false ; } //new followers cannot be added to people if ( is_person ( $ this -> _entity ) ) { return false ; } return $ this -> _entity -> authorize ( 'action' , 'leadable:add' ) ; }
If true then the viewer can add new followers to the this actor.

@param AnCommandContext $context Context parameter

@return bool
If true then the viewer can add new followers to the this actor .