public static function getControllerAccess($controllerClassName)
    {
        try{
            $returnValue = self::getCacheImplementation()->get(self::SERIAL_PREFIX_MODULE.$controllerClassName);
        } catch (\common_cache_Exception $e) {
            
            $extId = MapHelper::getExtensionFromController($controllerClassName);
            $extension = MapHelper::getUriForExtension($extId);
            $module = MapHelper::getUriForController($controllerClassName);
            
            $roleClass = new \core_kernel_classes_Class(GenerisRdf::CLASS_ROLE);
            $accessProperty = new \core_kernel_classes_Property(AccessService::PROPERTY_ACL_GRANTACCESS);

            $returnValue = array('module' => array(), 'actions' => array());
            
            // roles by extensions
            $roles = $roleClass->searchInstances(array(
                    $accessProperty->getUri() => $extension
                ), array(
                    'recursive' => true, 'like' => false
            ));
            foreach ($roles as $grantedRole) {
                $returnValue['module'][] = $grantedRole->getUri();
            }
            
            // roles by controller
            $filters = array(
                $accessProperty->getUri() => $module
            );
            $options = array('recursive' => true, 'like' => false);
            
            foreach ($roleClass->searchInstances($filters, $options) as $grantedRole){
                $returnValue['module'][] = $grantedRole->getUri();
            }
            
            // roles by action
            foreach (ControllerHelper::getActions($controllerClassName) as $actionName) {
                $actionUri = MapHelper::getUriForAction($controllerClassName, $actionName);
                $rolesForAction = $roleClass->searchInstances(array(
                    $accessProperty->getUri() => $actionUri
                ), array('recursive' => true, 'like' => false));
                if (!empty($rolesForAction)) {
                    $actionName = MapHelper::getActionFromUri($actionUri);
                    $returnValue['actions'][$actionName] = array();
                    foreach ($rolesForAction as $roleResource) {
                        $returnValue['actions'][$actionName][] = $roleResource->getUri();
                    }
                }
            }
            
            self::getCacheImplementation()->put($returnValue, self::SERIAL_PREFIX_MODULE.$controllerClassName);
        }
        return $returnValue;
    }
public static function getControllerAccess($controllerClassName)
    {
        try{
            $returnValue = self::getCacheImplementation()->get(self::SERIAL_PREFIX_MODULE.$controllerClassName);
        } catch (\common_cache_Exception $e) {
            
            $extId = MapHelper::getExtensionFromController($controllerClassName);
            $extension = MapHelper::getUriForExtension($extId);
            $module = MapHelper::getUriForController($controllerClassName);
            
            $roleClass = new \core_kernel_classes_Class(GenerisRdf::CLASS_ROLE);
            $accessProperty = new \core_kernel_classes_Property(AccessService::PROPERTY_ACL_GRANTACCESS);

            $returnValue = array('module' => array(), 'actions' => array());
            
            // roles by extensions
            $roles = $roleClass->searchInstances(array(
                    $accessProperty->getUri() => $extension
                ), array(
                    'recursive' => true, 'like' => false
            ));
            foreach ($roles as $grantedRole) {
                $returnValue['module'][] = $grantedRole->getUri();
            }
            
            // roles by controller
            $filters = array(
                $accessProperty->getUri() => $module
            );
            $options = array('recursive' => true, 'like' => false);
            
            foreach ($roleClass->searchInstances($filters, $options) as $grantedRole){
                $returnValue['module'][] = $grantedRole->getUri();
            }
            
            // roles by action
            foreach (ControllerHelper::getActions($controllerClassName) as $actionName) {
                $actionUri = MapHelper::getUriForAction($controllerClassName, $actionName);
                $rolesForAction = $roleClass->searchInstances(array(
                    $accessProperty->getUri() => $actionUri
                ), array('recursive' => true, 'like' => false));
                if (!empty($rolesForAction)) {
                    $actionName = MapHelper::getActionFromUri($actionUri);
                    $returnValue['actions'][$actionName] = array();
                    foreach ($rolesForAction as $roleResource) {
                        $returnValue['actions'][$actionName][] = $roleResource->getUri();
                    }
                }
            }
            
            self::getCacheImplementation()->put($returnValue, self::SERIAL_PREFIX_MODULE.$controllerClassName);
        }
        return $returnValue;
    }
public static function getControllerAccess ( $ controllerClassName ) { try { $ returnValue = self :: getCacheImplementation ( ) -> get ( self :: SERIAL_PREFIX_MODULE . $ controllerClassName ) ; } catch ( \ common_cache_Exception $ e ) { $ extId = MapHelper :: getExtensionFromController ( $ controllerClassName ) ; $ extension = MapHelper :: getUriForExtension ( $ extId ) ; $ module = MapHelper :: getUriForController ( $ controllerClassName ) ; $ roleClass = new \ core_kernel_classes_Class ( GenerisRdf :: CLASS_ROLE ) ; $ accessProperty = new \ core_kernel_classes_Property ( AccessService :: PROPERTY_ACL_GRANTACCESS ) ; $ returnValue = array ( 'module' => array ( ) , 'actions' => array ( ) ) ; // roles by extensions $ roles = $ roleClass -> searchInstances ( array ( $ accessProperty -> getUri ( ) => $ extension ) , array ( 'recursive' => true , 'like' => false ) ) ; foreach ( $ roles as $ grantedRole ) { $ returnValue [ 'module' ] [ ] = $ grantedRole -> getUri ( ) ; } // roles by controller $ filters = array ( $ accessProperty -> getUri ( ) => $ module ) ; $ options = array ( 'recursive' => true , 'like' => false ) ; foreach ( $ roleClass -> searchInstances ( $ filters , $ options ) as $ grantedRole ) { $ returnValue [ 'module' ] [ ] = $ grantedRole -> getUri ( ) ; } // roles by action foreach ( ControllerHelper :: getActions ( $ controllerClassName ) as $ actionName ) { $ actionUri = MapHelper :: getUriForAction ( $ controllerClassName , $ actionName ) ; $ rolesForAction = $ roleClass -> searchInstances ( array ( $ accessProperty -> getUri ( ) => $ actionUri ) , array ( 'recursive' => true , 'like' => false ) ) ; if ( ! empty ( $ rolesForAction ) ) { $ actionName = MapHelper :: getActionFromUri ( $ actionUri ) ; $ returnValue [ 'actions' ] [ $ actionName ] = array ( ) ; foreach ( $ rolesForAction as $ roleResource ) { $ returnValue [ 'actions' ] [ $ actionName ] [ ] = $ roleResource -> getUri ( ) ; } } } self :: getCacheImplementation ( ) -> put ( $ returnValue , self :: SERIAL_PREFIX_MODULE . $ controllerClassName ) ; } return $ returnValue ; }
Return the cached description of the roles
that have access to this controller

@param string $controllerClassName
@return array
Return the cached description of the roles that have access to this controller