From dfe79b20f5f71247143bed46f4ec2c2731726578 Mon Sep 17 00:00:00 2001 From: sindhuba <122321535+sindhuba@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:58:05 -0700 Subject: [PATCH] Address RBAC local storage default setting issue (#1892) * Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Address errors and checks * Cleanup DP RBAC code * Run format * Fix unit tests * Remove unnecessary code * Run npm format * Fix enableAadDataPlane feature flag behavior * Fix enable AAD dataplane feature flag behavior * Address feedback comments * Minor fix * Add new fixes * Fix Tables test * Run npm format * Address Local storage default setting issue * Run npm format * Address lint error * Run format --------- Co-authored-by: Asier Isayas --- src/hooks/useKnockoutExplorer.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 3ee6a04a4..21461d363 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -290,6 +290,11 @@ async function configureHostedWithAAD(config: AAD): Promise { } updateUserContext({ dataPlaneRbacEnabled }); + } else { + const dataPlaneRbacEnabled = account.properties.disableLocalAuth; + + updateUserContext({ dataPlaneRbacEnabled }); + useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled }); } } else { const keys: DatabaseAccountListKeysResult = await listKeys(subscriptionId, resourceGroup, account.name); @@ -485,6 +490,11 @@ async function configurePortal(): Promise { dataPlaneRbacEnabled = isDataPlaneRbacSetting === Constants.RBACOptions.setTrueRBACOption; } + updateUserContext({ dataPlaneRbacEnabled }); + useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled }); + } else { + const dataPlaneRbacEnabled = account.properties.disableLocalAuth; + updateUserContext({ dataPlaneRbacEnabled }); useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled }); }