Files
cloudbeaver/webapp/packages/core-authentication/src/AuthSettingsService.ts
T
8f54e759dd CB-4541 feat: tree filter (#2908)
* CB-4541 feat: tree filter

* CB-4541 feat: tree empty placeholders

* CB-4541 fix: settings overflow scroll effect

* CB-4541 fix: settings groups size

* CB-4541 fix: sync groups when filtering

* CB-4541 chore: performance optimization

* chore: review fixes

* chore: replace inline styles

* chore: replace inline styles

* chore: hide extra settings from UI

* chore: hide groups view from settings

* fix: add override options to devtools

* fix: trim filter in settings search

* chore: localization

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: kseniaguzeeva <112612526+kseniaguzeeva@users.noreply.github.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2024-09-25 19:46:13 +03:00

49 lines
1.6 KiB
TypeScript

/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { injectable } from '@cloudbeaver/core-di';
import { SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
import { schema, schemaExtra } from '@cloudbeaver/core-utils';
const settingsSchema = schema.object({
'core.authentication.disableAnonymousAccess': schemaExtra.stringedBoolean().default(false),
});
export type AuthSettings = schema.infer<typeof settingsSchema>;
@injectable()
export class AuthSettingsService {
get disableAnonymousAccess(): boolean {
return this.settings.getValue('core.authentication.disableAnonymousAccess');
}
readonly settings: SettingsProvider<typeof settingsSchema>;
constructor(
private readonly settingsProviderService: SettingsProviderService,
private readonly settingsManagerService: SettingsManagerService,
) {
this.settings = this.settingsProviderService.createSettings(settingsSchema);
this.registerSettings();
}
private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
// {
// key: 'core.authentication.disableAnonymousAccess',
// access: {
// scope: ['server'],
// },
// type: ESettingsValueType.Checkbox,
// name: 'settings_authentication_disable_anonymous_access_name',
// description: 'settings_authentication_disable_anonymous_access_description',
// group: AUTH_SETTINGS_GROUP,
// },
]);
}
}