protected function _authorizeAdd(AnCommandContext $context)
    {
        $can_publish = get_config_value($this->_entity->component, 'can_publish', self::CAN_ADD_ADMIN);

        switch ($can_publish) {
            case self::CAN_ADD_ADMIN :
                return $this->_viewer->admin();
            case self::CAN_ADD_SPECIAL :
                return $this->_viewer->usertype != 'Registered' && !$this->_viewer->guest();
            case self::CAN_ADD_ALL :
                return !$this->_viewer->guest();
            default :
                return false;
        }
    }
protected function _authorizeAdd(AnCommandContext $context)
    {
        $can_publish = get_config_value($this->_entity->component, 'can_publish', self::CAN_ADD_ADMIN);

        switch ($can_publish) {
            case self::CAN_ADD_ADMIN :
                return $this->_viewer->admin();
            case self::CAN_ADD_SPECIAL :
                return $this->_viewer->usertype != 'Registered' && !$this->_viewer->guest();
            case self::CAN_ADD_ALL :
                return !$this->_viewer->guest();
            default :
                return false;
        }
    }
protected function _authorizeAdd ( AnCommandContext $ context ) { $ can_publish = get_config_value ( $ this -> _entity -> component , 'can_publish' , self :: CAN_ADD_ADMIN ) ; switch ( $ can_publish ) { case self :: CAN_ADD_ADMIN : return $ this -> _viewer -> admin ( ) ; case self :: CAN_ADD_SPECIAL : return $ this -> _viewer -> usertype != 'Registered' && ! $ this -> _viewer -> guest ( ) ; case self :: CAN_ADD_ALL : return ! $ this -> _viewer -> guest ( ) ; default : return false ; } }
Authorize whether we can add a new actor or not.

@param AnCommandContext $context

@return bool
Authorize whether we can add a new actor or not .