public function getActions()
    {
        $this->beforeAction();
        $role = new \core_kernel_classes_Resource($this->getRequestParameter('role'));
        $included = array();
        foreach (\tao_models_classes_RoleService::singleton()->getIncludedRoles($role) as $includedRole) {
            $included[] = $includedRole->getUri();
        }
        $module = new \core_kernel_classes_Resource($this->getRequestParameter('module'));

        $controllerClassName = MapHelper::getControllerFromUri($module->getUri());
        $controllerAccess = CacheHelper::getControllerAccess($controllerClassName);

        $actions = array();
        foreach (ControllerHelper::getActions($controllerClassName) as $actionName) {
            $uri = MapHelper::getUriForAction($controllerClassName, $actionName);
            $part = explode('#', $uri);
            list($type, $extId, $modId, $actId) = explode('_', $part[1]);

            $allowedRoles = isset($controllerAccess['actions'][$actionName])
                ? array_merge($controllerAccess['module'], $controllerAccess['actions'][$actionName])
                : $controllerAccess['module'];

            $access = count(array_intersect($included, $allowedRoles)) > 0
                ? self::ACCESS_INHERITED
                : (in_array($role->getUri(), $allowedRoles)
                    ? self::ACCESS_FULL
                    : self::ACCESS_NONE);

            $actions[$actId] = array(
                'uri' => $uri,
                'access' => $access,
                'locked' => $this->isLocked(),
            );
        }

        ksort($actions);

        $this->returnJson($actions);
    }
public function getActions()
    {
        $this->beforeAction();
        $role = new \core_kernel_classes_Resource($this->getRequestParameter('role'));
        $included = array();
        foreach (\tao_models_classes_RoleService::singleton()->getIncludedRoles($role) as $includedRole) {
            $included[] = $includedRole->getUri();
        }
        $module = new \core_kernel_classes_Resource($this->getRequestParameter('module'));

        $controllerClassName = MapHelper::getControllerFromUri($module->getUri());
        $controllerAccess = CacheHelper::getControllerAccess($controllerClassName);

        $actions = array();
        foreach (ControllerHelper::getActions($controllerClassName) as $actionName) {
            $uri = MapHelper::getUriForAction($controllerClassName, $actionName);
            $part = explode('#', $uri);
            list($type, $extId, $modId, $actId) = explode('_', $part[1]);

            $allowedRoles = isset($controllerAccess['actions'][$actionName])
                ? array_merge($controllerAccess['module'], $controllerAccess['actions'][$actionName])
                : $controllerAccess['module'];

            $access = count(array_intersect($included, $allowedRoles)) > 0
                ? self::ACCESS_INHERITED
                : (in_array($role->getUri(), $allowedRoles)
                    ? self::ACCESS_FULL
                    : self::ACCESS_NONE);

            $actions[$actId] = array(
                'uri' => $uri,
                'access' => $access,
                'locked' => $this->isLocked(),
            );
        }

        ksort($actions);

        $this->returnJson($actions);
    }
public function getActions ( ) { $ this -> beforeAction ( ) ; $ role = new \ core_kernel_classes_Resource ( $ this -> getRequestParameter ( 'role' ) ) ; $ included = array ( ) ; foreach ( \ tao_models_classes_RoleService :: singleton ( ) -> getIncludedRoles ( $ role ) as $ includedRole ) { $ included [ ] = $ includedRole -> getUri ( ) ; } $ module = new \ core_kernel_classes_Resource ( $ this -> getRequestParameter ( 'module' ) ) ; $ controllerClassName = MapHelper :: getControllerFromUri ( $ module -> getUri ( ) ) ; $ controllerAccess = CacheHelper :: getControllerAccess ( $ controllerClassName ) ; $ actions = array ( ) ; foreach ( ControllerHelper :: getActions ( $ controllerClassName ) as $ actionName ) { $ uri = MapHelper :: getUriForAction ( $ controllerClassName , $ actionName ) ; $ part = explode ( '#' , $ uri ) ; list ( $ type , $ extId , $ modId , $ actId ) = explode ( '_' , $ part [ 1 ] ) ; $ allowedRoles = isset ( $ controllerAccess [ 'actions' ] [ $ actionName ] ) ? array_merge ( $ controllerAccess [ 'module' ] , $ controllerAccess [ 'actions' ] [ $ actionName ] ) : $ controllerAccess [ 'module' ] ; $ access = count ( array_intersect ( $ included , $ allowedRoles ) ) > 0 ? self :: ACCESS_INHERITED : ( in_array ( $ role -> getUri ( ) , $ allowedRoles ) ? self :: ACCESS_FULL : self :: ACCESS_NONE ) ; $ actions [ $ actId ] = array ( 'uri' => $ uri , 'access' => $ access , 'locked' => $ this -> isLocked ( ) , ) ; } ksort ( $ actions ) ; $ this -> returnJson ( $ actions ) ; }
Shows the access to the actions of a controller for a specific role

@throws \common_exception_Error
@throws \common_ext_ExtensionException
@throws common_exception_BadRequest
Shows the access to the actions of a controller for a specific role