From 45d34b5516d06d673c2a445ee8e254988369b15b Mon Sep 17 00:00:00 2001 From: yuboluo Date: Thu, 25 Jul 2024 08:50:51 +0800 Subject: [PATCH] [Bug][Workspace] Add permission validation at workspace detail page (#7435) * [Bug][Workspace] Add permission validate at workspace detail page Signed-off-by: yubonluo * Changeset file for PR #7435 created/updated --------- Signed-off-by: yubonluo Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> --- changelogs/fragments/7435.yml | 2 ++ .../public/components/workspace_detail/workspace_updater.tsx | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/7435.yml diff --git a/changelogs/fragments/7435.yml b/changelogs/fragments/7435.yml new file mode 100644 index 00000000000..c5cf951ee51 --- /dev/null +++ b/changelogs/fragments/7435.yml @@ -0,0 +1,2 @@ +fix: +- [Bug][Workspace] Add permission validation at workspace detail page ([#7435](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7435)) \ No newline at end of file diff --git a/src/plugins/workspace/public/components/workspace_detail/workspace_updater.tsx b/src/plugins/workspace/public/components/workspace_detail/workspace_updater.tsx index 7ba838303a8..9005646fd80 100644 --- a/src/plugins/workspace/public/components/workspace_detail/workspace_updater.tsx +++ b/src/plugins/workspace/public/components/workspace_detail/workspace_updater.tsx @@ -65,6 +65,7 @@ export const WorkspaceUpdater = (props: WorkspaceUpdaterProps) => { dataSourceManagement?: DataSourceManagementPluginSetup; }>(); + const isPermissionEnabled = application?.capabilities.workspaces.permissionEnabled; const currentWorkspace = useObservable(workspaces ? workspaces.currentWorkspace$ : of(null)); const availableUseCases = useObservable(props.registeredUseCases$, []); const [currentWorkspaceFormData, setCurrentWorkspaceFormData] = useState(); @@ -160,6 +161,7 @@ export const WorkspaceUpdater = (props: WorkspaceUpdaterProps) => { onSubmit={handleWorkspaceFormSubmit} operationType={WorkspaceOperationType.Update} savedObjects={savedObjects} + permissionEnabled={isPermissionEnabled} detailTab={props.detailTab} dataSourceManagement={dataSourceManagement} availableUseCases={availableUseCases}