public static function checkAccess($permissionName, $user = false, $params = [])
    {
        if (is_array($permissionName)) {
            $permissionName = self::createPermissionName($permissionName);
        }
        if (!$user) {
            $user = Yii::$app->user;
        }

        if (!$user->isGuest && !isset(self::$userRoles[$user->id])) {
            self::$userRoles[$user->id] = Yii::$app->authManager->getRolesByUser($user->id);
        }

        if (isset(self::$userRoles[$user->id][self::ROLE_ROOT])) {
            return true;
        }

        if (!self::$defaultRoles) {
            self::setDefaultRoles($user->id);
        }
        if (in_array($permissionName, self::$defaultRoles)) {
            return true;
        }

        return $user->can($permissionName, $params);
    }