protected function _authorizeAccess(AnCommandContext $context)
    {
        //if entity is not privatable then it doesn't have access to allow method
        if (!$this->_entity->isPrivatable()) {
            return true;
        }

        if ($this->_viewer->admin()) {
            return true;
        }

        if ($this->_entity->isFollowable() && $this->_entity->blocking($this->_viewer)) {
            return false;
        }

        if ($this->_entity->allows($this->_viewer, 'access')) {
            return true;
        }

        return false;
    }
protected function _authorizeAccess(AnCommandContext $context)
    {
        //if entity is not privatable then it doesn't have access to allow method
        if (!$this->_entity->isPrivatable()) {
            return true;
        }

        if ($this->_viewer->admin()) {
            return true;
        }

        if ($this->_entity->isFollowable() && $this->_entity->blocking($this->_viewer)) {
            return false;
        }

        if ($this->_entity->allows($this->_viewer, 'access')) {
            return true;
        }

        return false;
    }
protected function _authorizeAccess ( AnCommandContext $ context ) { //if entity is not privatable then it doesn't have access to allow method if ( ! $ this -> _entity -> isPrivatable ( ) ) { return true ; } if ( $ this -> _viewer -> admin ( ) ) { return true ; } if ( $ this -> _entity -> isFollowable ( ) && $ this -> _entity -> blocking ( $ this -> _viewer ) ) { return false ; } if ( $ this -> _entity -> allows ( $ this -> _viewer , 'access' ) ) { return true ; } return false ; }
Check if the actor authorize viewing a resource.

@param AnCommandContext $context Context parameter

@return bool
Check if the actor authorize viewing a resource .