Skip to content

Commit a927330

Browse files
[Write restricted dashboards] Enable feature by default (#246602)
## Summary This PR enabled the Saved Objects Access Control feature by default in non-serverless offerings. This feature is what powers write-restricted dashboards. ### Testing 1. Start ES & KB normally 2. Log in as an admin user and add sample data 3. Navigate to Dashboards and open any of the sample dashboards 4. Click the share button and verify that the access mode options appears in the share modal 5. Repeat the test but add `savedObjects.enableAccessControl: false` to the Kibana config, and verify that the access mode does not appear in the share modal 6. Remove `savedObjects.enableAccessControl: false` from the Kibana config, start ES & KB in serverless mode, verify that the access mode does not appear in the share modal Note: a release note was already added in #224552 --------- Co-authored-by: Ryan <ryan.godfrey@elastic.co>
1 parent 2338990 commit a927330

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

config/serverless.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,6 @@ xpack.genAiSettings:
301301
# Cross Project Search
302302
cps.enabled: true
303303
cps.cpsEnabled: false
304+
305+
# Disable saved objects access control features (write-restricted dashboards)
306+
savedObjects.enableAccessControl: false

src/core/packages/saved-objects/base-server-internal/src/saved_objects_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const soSchema = schema.object({
8282
schema.boolean({ defaultValue: true }),
8383
schema.boolean({ defaultValue: false })
8484
),
85-
enableAccessControl: schema.boolean({ defaultValue: false }),
85+
enableAccessControl: schema.boolean({ defaultValue: true }),
8686
});
8787

8888
export type SavedObjectsConfigType = TypeOf<typeof soSchema>;

src/core/packages/saved-objects/base-server-internal/src/serialization/serializer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const createMockedTypeRegistry = ({
1818
isNamespaceAgnostic,
1919
isSingleNamespace,
2020
isMultiNamespace,
21-
accessControlEnabled = false, // default to false
21+
accessControlEnabled = true, // default to true
2222
}: {
2323
isNamespaceAgnostic: boolean;
2424
isSingleNamespace: boolean;

src/core/packages/saved-objects/server-internal/src/saved_objects_service.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ describe('SavedObjectsService', () => {
101101
return new BehaviorSubject({
102102
maxImportPayloadBytes: new ByteSizeValue(0),
103103
maxImportExportSize: 10000,
104-
enableAccessControl: accessControlEnabled ?? false,
104+
enableAccessControl: accessControlEnabled ?? true, // default to true
105105
});
106106
});
107107
return mockCoreContext.create({ configService, env });
@@ -406,18 +406,18 @@ describe('SavedObjectsService', () => {
406406
});
407407

408408
describe('#isAccessControlEnabled', () => {
409-
it('returns false by default', async () => {
409+
it('returns true by default', async () => {
410410
const coreContext = createCoreContext({});
411411
const soService = new SavedObjectsService(coreContext);
412412
const { isAccessControlEnabled } = await soService.setup(createSetupDeps());
413-
expect(isAccessControlEnabled()).toEqual(false);
413+
expect(isAccessControlEnabled()).toEqual(true);
414414
});
415415

416-
it('can be set to true', async () => {
417-
const coreContext = createCoreContext({ accessControlEnabled: true });
416+
it('can be set to false', async () => {
417+
const coreContext = createCoreContext({ accessControlEnabled: false });
418418
const soService = new SavedObjectsService(coreContext);
419419
const { isAccessControlEnabled } = await soService.setup(createSetupDeps());
420-
expect(isAccessControlEnabled()).toEqual(true);
420+
expect(isAccessControlEnabled()).toEqual(false);
421421
});
422422

423423
describe('#setAccessControlTransforms', () => {

0 commit comments

Comments
 (0)