Skip to content

Commit

Permalink
[Bug][Workspace] Add permission validation at workspace detail page (o…
Browse files Browse the repository at this point in the history
…pensearch-project#7435)

* [Bug][Workspace] Add permission validate at workspace detail page

Signed-off-by: yubonluo <[email protected]>

* Changeset file for PR opensearch-project#7435 created/updated

---------

Signed-off-by: yubonluo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 45d34b5)
  • Loading branch information
yubonluo authored and LDrago27 committed Jul 25, 2024
1 parent 6768bba commit e9ca5a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/7435.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [Bug][Workspace] Add permission validation at workspace detail page ([#7435](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7435))
Original file line number Diff line number Diff line change
Expand Up @@ -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<FormDataFromWorkspace>();
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit e9ca5a7

Please sign in to comment.