From 86fcb49f9aa1dbabaa77666b254470d8a38de4ac Mon Sep 17 00:00:00 2001 From: SuZhou-Joe Date: Fri, 29 Sep 2023 10:17:09 +0000 Subject: [PATCH] feat: make permissions field optional Signed-off-by: SuZhou-Joe --- .../workspace/server/integration_tests/routes.test.ts | 5 ----- src/plugins/workspace/server/routes/index.ts | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/plugins/workspace/server/integration_tests/routes.test.ts b/src/plugins/workspace/server/integration_tests/routes.test.ts index 7aa8899e09f..a83c908b7d1 100644 --- a/src/plugins/workspace/server/integration_tests/routes.test.ts +++ b/src/plugins/workspace/server/integration_tests/routes.test.ts @@ -15,11 +15,6 @@ const testWorkspace: WorkspaceAttribute & { id: 'fake_id', name: 'test_workspace', description: 'test_workspace_description', - permissions: { - modes: [WorkspacePermissionMode.Write, WorkspacePermissionMode.LibraryWrite], - type: 'user', - userId: '*', - }, }; describe('workspace service', () => { diff --git a/src/plugins/workspace/server/routes/index.ts b/src/plugins/workspace/server/routes/index.ts index 21475ede368..02a656674b2 100644 --- a/src/plugins/workspace/server/routes/index.ts +++ b/src/plugins/workspace/server/routes/index.ts @@ -46,7 +46,9 @@ const workspaceAttributesSchema = schema.object({ icon: schema.maybe(schema.string()), reserved: schema.maybe(schema.boolean()), defaultVISTheme: schema.maybe(schema.string()), - permissions: schema.oneOf([workspacePermission, schema.arrayOf(workspacePermission)]), + permissions: schema.maybe( + schema.oneOf([workspacePermission, schema.arrayOf(workspacePermission)]) + ), }); const convertToACL = (