Skip to content

Commit

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

* fix: workspace permission entire update



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



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

This reverts commit a4b7ba7.



* Revert "fix: workspace permission entire update"

This reverts commit d972e13.



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



* feat: add workspace version limit for object update



---------


(cherry picked from commit 0bd03df)

Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 8b555af commit 9e0e979
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 9e0e979

Please sign in to comment.