src/helpers/RBACHelper.php
protected static function getDefaultRoutes()
    {
        if (self::$_defaultRoutes === null) {
            $manager = self::getAuthManager();
            $roles = $manager->defaultRoles;
            if ($manager->cache && ($routes = $manager->cache->get($roles)) !== false) {
                self::$_defaultRoutes = $routes;
            } else {
                $permissions = self::$_defaultRoutes = [];
                foreach ($roles as $role) {
                    $permissions = array_merge($permissions, $manager->getPermissionsByRole($role));
                }
                foreach ($permissions as $item) {
                    if ($item->name[0] === '/') {
                        self::$_defaultRoutes[$item->name] = true;
                    }
                }
                if ($manager->cache) {
                    $manager->cache->set($roles, self::$_defaultRoutes, $manager->cacheDuration, new TagDependency([
                        'tags' => $manager->cacheTag
                    ]));
                }
            }
        }
        return self::$_defaultRoutes;
    }
protected static function getDefaultRoutes()
    {
        if (self::$_defaultRoutes === null) {
            $manager = self::getAuthManager();
            $roles = $manager->defaultRoles;
            if ($manager->cache && ($routes = $manager->cache->get($roles)) !== false) {
                self::$_defaultRoutes = $routes;
            } else {
                $permissions = self::$_defaultRoutes = [];
                foreach ($roles as $role) {
                    $permissions = array_merge($permissions, $manager->getPermissionsByRole($role));
                }
                foreach ($permissions as $item) {
                    if ($item->name[0] === '/') {
                        self::$_defaultRoutes[$item->name] = true;
                    }
                }
                if ($manager->cache) {
                    $manager->cache->set($roles, self::$_defaultRoutes, $manager->cacheDuration, new TagDependency([
                        'tags' => $manager->cacheTag
                    ]));
                }
            }
        }
        return self::$_defaultRoutes;
    }
protected static function getDefaultRoutes ( ) { if ( self :: $ _defaultRoutes === null ) { $ manager = self :: getAuthManager ( ) ; $ roles = $ manager -> defaultRoles ; if ( $ manager -> cache && ( $ routes = $ manager -> cache -> get ( $ roles ) ) !== false ) { self :: $ _defaultRoutes = $ routes ; } else { $ permissions = self :: $ _defaultRoutes = [ ] ; foreach ( $ roles as $ role ) { $ permissions = array_merge ( $ permissions , $ manager -> getPermissionsByRole ( $ role ) ) ; } foreach ( $ permissions as $ item ) { if ( $ item -> name [ 0 ] === '/' ) { self :: $ _defaultRoutes [ $ item -> name ] = true ; } } if ( $ manager -> cache ) { $ manager -> cache -> set ( $ roles , self :: $ _defaultRoutes , $ manager -> cacheDuration , new TagDependency ( [ 'tags' => $ manager -> cacheTag ] ) ) ; } } } return self :: $ _defaultRoutes ; }
Get assigned routes by default roles
@return array
Get assigned routes by default roles