original_string: protected function createAclConfigFromPrivileges($controllerService, array $privileges, &$aclConfig, $denyByDefault)
      {
          // Normalize the controller service name.
          // zend-mvc will always pass the name using namespace seprators, but
          // the admin may write the name using dash seprators.
          $controllerService = strtr($controllerService, '-', '\\');
          if (isset($privileges['actions'])) {
              foreach ($privileges['actions'] as $action => $methods) {
                  $action = lcfirst($action);
                  $aclConfig[] = [
                      'resource'   => sprintf('%s::%s', $controllerService, $action),
                      'privileges' => $this->createPrivilegesFromMethods($methods, $denyByDefault),
                  ];
              }
          }
  
          if (isset($privileges['collection'])) {
              $aclConfig[] = [
                  'resource'   => sprintf('%s::collection', $controllerService),
                  'privileges' => $this->createPrivilegesFromMethods($privileges['collection'], $denyByDefault),
              ];
          }
  
          if (isset($privileges['entity'])) {
              $aclConfig[] = [
                  'resource'   => sprintf('%s::entity', $controllerService),
                  'privileges' => $this->createPrivilegesFromMethods($privileges['entity'], $denyByDefault),
              ];
          }
      }
code: protected function createAclConfigFromPrivileges($controllerService, array $privileges, &$aclConfig, $denyByDefault)
      {
          // Normalize the controller service name.
          // zend-mvc will always pass the name using namespace seprators, but
          // the admin may write the name using dash seprators.
          $controllerService = strtr($controllerService, '-', '\\');
          if (isset($privileges['actions'])) {
              foreach ($privileges['actions'] as $action => $methods) {
                  $action = lcfirst($action);
                  $aclConfig[] = [
                      'resource'   => sprintf('%s::%s', $controllerService, $action),
                      'privileges' => $this->createPrivilegesFromMethods($methods, $denyByDefault),
                  ];
              }
          }
  
          if (isset($privileges['collection'])) {
              $aclConfig[] = [
                  'resource'   => sprintf('%s::collection', $controllerService),
                  'privileges' => $this->createPrivilegesFromMethods($privileges['collection'], $denyByDefault),
              ];
          }
  
          if (isset($privileges['entity'])) {
              $aclConfig[] = [
                  'resource'   => sprintf('%s::entity', $controllerService),
                  'privileges' => $this->createPrivilegesFromMethods($privileges['entity'], $denyByDefault),
              ];
          }
      }
code_tokens: protected function createAclConfigFromPrivileges ( $ controllerService , array $ privileges , & $ aclConfig , $ denyByDefault ) { // Normalize the controller service name. // zend-mvc will always pass the name using namespace seprators, but // the admin may write the name using dash seprators. $ controllerService = strtr ( $ controllerService , '-' , '\\' ) ; if ( isset ( $ privileges [ 'actions' ] ) ) { foreach ( $ privileges [ 'actions' ] as $ action => $ methods ) { $ action = lcfirst ( $ action ) ; $ aclConfig [ ] = [ 'resource' => sprintf ( '%s::%s' , $ controllerService , $ action ) , 'privileges' => $ this -> createPrivilegesFromMethods ( $ methods , $ denyByDefault ) , ] ; } } if ( isset ( $ privileges [ 'collection' ] ) ) { $ aclConfig [ ] = [ 'resource' => sprintf ( '%s::collection' , $ controllerService ) , 'privileges' => $ this -> createPrivilegesFromMethods ( $ privileges [ 'collection' ] , $ denyByDefault ) , ] ; } if ( isset ( $ privileges [ 'entity' ] ) ) { $ aclConfig [ ] = [ 'resource' => sprintf ( '%s::entity' , $ controllerService ) , 'privileges' => $ this -> createPrivilegesFromMethods ( $ privileges [ 'entity' ] , $ denyByDefault ) , ] ; } }
docstring: Creates ACL configuration based on the privileges configured
  
  - Extracts a privilege per action
  - Extracts privileges for each of "collection" and "entity" configured
  
  @param string $controllerService
  @param array $privileges
  @param array $aclConfig
  @param bool $denyByDefault
docstring_tokens: Creates ACL configuration based on the privileges configured