protected function _authorizeVote($context)
    {
        if ($this->_viewer->guest()) {
            return false;
        }

        //if the owner has blocked the viewer or the other way around, return false

        if ($this->_entity instanceof ComBaseDomainEntityComment) {
            $owner = $this->_entity->parent->owner;
        } elseif ($this->_entity->isOwnable()) {
            $owner = $this->_entity->owner;
        } elseif (is_person($this->_entity)) {
            $owner = $this->_entity;
        }

        if ($owner && ($owner->blocking($this->_viewer) || $this->_viewer->blocking($owner))) {
            return false;
        }

        return $this->_entity->isVotable();
    }
protected function _authorizeVote($context)
    {
        if ($this->_viewer->guest()) {
            return false;
        }

        //if the owner has blocked the viewer or the other way around, return false

        if ($this->_entity instanceof ComBaseDomainEntityComment) {
            $owner = $this->_entity->parent->owner;
        } elseif ($this->_entity->isOwnable()) {
            $owner = $this->_entity->owner;
        } elseif (is_person($this->_entity)) {
            $owner = $this->_entity;
        }

        if ($owner && ($owner->blocking($this->_viewer) || $this->_viewer->blocking($owner))) {
            return false;
        }

        return $this->_entity->isVotable();
    }
protected function _authorizeVote ( $ context ) { if ( $ this -> _viewer -> guest ( ) ) { return false ; } //if the owner has blocked the viewer or the other way around, return false if ( $ this -> _entity instanceof ComBaseDomainEntityComment ) { $ owner = $ this -> _entity -> parent -> owner ; } elseif ( $ this -> _entity -> isOwnable ( ) ) { $ owner = $ this -> _entity -> owner ; } elseif ( is_person ( $ this -> _entity ) ) { $ owner = $ this -> _entity ; } if ( $ owner && ( $ owner -> blocking ( $ this -> _viewer ) || $ this -> _viewer -> blocking ( $ owner ) ) ) { return false ; } return $ this -> _entity -> isVotable ( ) ; }
Check if a node authroize being voted.

@param AnCommandContext $context Context parameter

@return bool
Check if a node authroize being voted .