Skip to content

Commit

Permalink
Revert "Fix access control tab fetching for remote cluster (opensearc…
Browse files Browse the repository at this point in the history
…h-project#7456)"

This reverts commit d152ced.
  • Loading branch information
ananzh committed Jul 24, 2024
1 parent 9b2f264 commit 4429721
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ interface AccessControlTabProps {
connector: string;
properties: unknown;
allowedRoles: string[];
dataSourceMDSId: string;
}

export const AccessControlTab = (props: AccessControlTabProps) => {
Expand All @@ -35,17 +34,17 @@ export const AccessControlTab = (props: AccessControlTabProps) => {
const { http } = useOpenSearchDashboards<DataSourceManagementContext>().services;

useEffect(() => {
http
.get(SECURITY_ROLES, { query: { dataSourceId: props.dataSourceMDSId } })
.then((data) => {
http!
.get(SECURITY_ROLES)
.then((data) =>
setRoles(
Object.keys(data.data).map((key) => {
return { label: key };
})
);
})
)
)
.catch((err) => setHasSecurityAccess(false));
}, [http, props.dataSourceMDSId]);
}, [http]);

const [selectedQueryPermissionRoles, setSelectedQueryPermissionRoles] = useState<Role[]>(
props.allowedRoles.map((role) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ export const DirectQueryDataConnectionDetail: React.FC<DirectQueryDataConnection
properties={datasourceDetails.properties}
allowedRoles={datasourceDetails.allowedRoles}
key={JSON.stringify(datasourceDetails.allowedRoles)}
dataSourceMDSId={featureFlagStatus ? dataSourceMDSId ?? '' : ''}
/>
),
},
Expand Down

0 comments on commit 4429721

Please sign in to comment.