protected function _authorizeAction(AnCommandContext $context)
    {
        $method = '_authorize'.ucfirst($context->action);

        $ret = self::AUTH_NOT_IMPLEMENTED;

        if (method_exists($this, $method)) {
            $ret = $this->$method($context->resource);
        } elseif ($context->actor) {
            //check if it's enabled and assigned
            if ($this->_entity->isAssignable()) {
                $ret = $this->_entity->activeForActor($context->actor);
            }
        }

        return $ret;
    }
protected function _authorizeAction(AnCommandContext $context)
    {
        $method = '_authorize'.ucfirst($context->action);

        $ret = self::AUTH_NOT_IMPLEMENTED;

        if (method_exists($this, $method)) {
            $ret = $this->$method($context->resource);
        } elseif ($context->actor) {
            //check if it's enabled and assigned
            if ($this->_entity->isAssignable()) {
                $ret = $this->_entity->activeForActor($context->actor);
            }
        }

        return $ret;
    }
protected function _authorizeAction ( AnCommandContext $ context ) { $ method = '_authorize' . ucfirst ( $ context -> action ) ; $ ret = self :: AUTH_NOT_IMPLEMENTED ; if ( method_exists ( $ this , $ method ) ) { $ ret = $ this -> $ method ( $ context -> resource ) ; } elseif ( $ context -> actor ) { //check if it's enabled and assigned if ( $ this -> _entity -> isAssignable ( ) ) { $ ret = $ this -> _entity -> activeForActor ( $ context -> actor ) ; } } return $ ret ; }
Authorizes whether the viewer can pubilsh anything within this component or not.

@param AnCommandContext $context

@return bool
Authorizes whether the viewer can pubilsh anything within this component or not .