/**
  * Factory method to create and configure a group provider from it's given configuration
  *
  * @static
  * @abstract
  * @param Zend_Config $config
  * @param string $userId
  * @return EngineBlock_Group_Provider_Grouper
  */
 public static function createFromConfigs(Zend_Config $config, $userId)
 {
     $grouperClient = Grouper_Client_Rest::createFromConfig($config);
     $provider = new self($config->id, $config->name, $grouperClient);
     $provider->setUserId($userId);
     $provider->configurePreconditions($config);
     $provider->configureGroupFilters($config);
     $provider->configureGroupMemberFilters($config);
     $decoratedProvider = $provider->configureDecoratorChain($config);
     return $decoratedProvider;
 }
 protected function _getGrouperClient()
 {
     if (!isset($this->_grouperClient)) {
         $applicationConfig = EngineBlock_ApplicationSingleton::getInstance()->getConfiguration();
         $configReader = new EngineBlock_Group_Provider_ProviderConfig();
         $config = $configReader->createFromDatabaseFor($applicationConfig->defaultGroupProvider);
         $this->_grouperClient = Grouper_Client_Rest::createFromConfig($config->current());
     }
     return $this->_grouperClient;
 }