示例#1
0
 public static function canRoute($route, $superAdminAllowed = true)
 {
     if ($superAdminAllowed and @Yii::$app->user->identity->isSuperadmin) {
         return true;
     }
     $baseRoute = AuthHelper::unifyRoute($route);
     if (Route::isFreeAccess($baseRoute)) {
         return true;
     }
     AuthHelper::ensurePermissionsUpToDate();
     return Route::isRouteAllowed($baseRoute, Yii::$app->session->get(AuthHelper::SESSION_PREFIX_ROUTES, []));
 }