Address feedback

This commit is contained in:
Senthamil Sindhu 2024-07-09 07:31:09 -07:00
parent 1ddd372c6d
commit dc289ece75
1 changed files with 9 additions and 17 deletions

View File

@ -494,24 +494,19 @@ async function configurePortal(): Promise<Explorer> {
const { databaseAccount: account, subscriptionId, resourceGroup } = userContext;
let dataPlaneRbacEnabled;
if (userContext.apiType === "SQL") {
if (LocalStorageUtility.hasItem(StorageKey.DataPlaneRbacEnabled)) {
const isDataPlaneRbacSetting = LocalStorageUtility.getEntryString(StorageKey.DataPlaneRbacEnabled);
let dataPlaneRbacEnabled;
if (isDataPlaneRbacSetting === Constants.RBACOptions.setAutomaticRBACOption) {
dataPlaneRbacEnabled = account.properties.disableLocalAuth;
} else {
dataPlaneRbacEnabled = isDataPlaneRbacSetting === Constants.RBACOptions.setTrueRBACOption;
}
if (!dataPlaneRbacEnabled) {
await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name);
}
updateUserContext({ dataPlaneRbacEnabled });
useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled });
} else {
const dataPlaneRbacEnabled = account.properties.disableLocalAuth;
dataPlaneRbacEnabled = account.properties.disableLocalAuth;
}
if (!dataPlaneRbacEnabled) {
await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name);
@ -519,12 +514,9 @@ async function configurePortal(): Promise<Explorer> {
updateUserContext({ dataPlaneRbacEnabled });
useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled });
}
} else {
if (userContext.apiType !== "Postgres" && userContext.apiType !== "VCoreMongo") {
} else if (userContext.apiType !== "Postgres" && userContext.apiType !== "VCoreMongo") {
await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name);
}
}
explorer = new Explorer();
resolve(explorer);