Skip to content

Commit

Permalink
fix: workspace permission entire update (opensearch-project#132)
Browse files Browse the repository at this point in the history
* fix: workspace permission entire update

Signed-off-by: Lin Wang <[email protected]>

* refactor: rename to convertToFullWorkspacePermissions and remove read and write permission

Signed-off-by: Lin Wang <[email protected]>

* Revert "refactor: rename to convertToFullWorkspacePermissions and remove read and write permission"

This reverts commit a4b7ba7.

Signed-off-by: Lin Wang <[email protected]>

* Revert "fix: workspace permission entire update"

This reverts commit d972e13.

Signed-off-by: Lin Wang <[email protected]>

* fix: update to client.create to override entire object

Signed-off-by: Lin Wang <[email protected]>

* feat: add workspace version limit for object update

Signed-off-by: Lin Wang <[email protected]>

---------

Signed-off-by: Lin Wang <[email protected]>
  • Loading branch information
wanglam authored Sep 11, 2023
1 parent 18300f0 commit 0bd03df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/plugins/workspace/server/workspace_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,14 @@ export class WorkspaceClientWithSavedObject implements IWorkspaceDBImpl {
throw new Error(DUPLICATE_WORKSPACE_NAME_ERROR);
}
}
await client.update<Omit<WorkspaceAttribute, 'id'>>(WORKSPACE_TYPE, id, attributes, {

await client.create<Omit<WorkspaceAttribute, 'id'>>(WORKSPACE_TYPE, attributes, {
id,
permissions,
overwrite: true,
version: workspaceInDB.version,
});

return {
success: true,
result: true,
Expand Down

0 comments on commit 0bd03df

Please sign in to comment.