Skip to content

Commit 954aa11

Browse files
committed
Uncomplicated the logic where we return false in the permissions for creating datasource actions on workspace IDE
1 parent 264be9f commit 954aa11

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

app/client/src/ce/utils/BusinessFeatures/permissionPageHelpers.tsx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,21 @@ export const hasCreateDSActionPermissionInApp = ({
176176
isEnabled: boolean;
177177
pagePermissions?: string[];
178178
}) => {
179-
return !ideType || ideType === IDE_TYPE.App
180-
? getHasCreateDatasourceActionPermission(isEnabled, dsPermissions) &&
181-
getHasCreateActionPermission(isEnabled, pagePermissions)
182-
: ideType !== IDE_TYPE.Workspace &&
183-
getHasCreateDatasourceActionPermission(isEnabled, dsPermissions);
179+
const hasDatasourcePermission = getHasCreateDatasourceActionPermission(
180+
isEnabled,
181+
dsPermissions,
182+
);
183+
184+
if (ideType === IDE_TYPE.Workspace) {
185+
return false;
186+
}
187+
188+
if (!ideType || ideType === IDE_TYPE.App) {
189+
return (
190+
hasDatasourcePermission &&
191+
getHasCreateActionPermission(isEnabled, pagePermissions)
192+
);
193+
}
194+
195+
return hasDatasourcePermission;
184196
};

app/client/src/entities/Engine/WorkspaceEditorEngine.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import {
1616
PluginsNotFoundError,
1717
} from "entities/Engine";
1818
import type { ReduxAction } from "actions/ReduxActionTypes";
19-
import { waitForFetchEnvironments } from "ee/sagas/EnvironmentSagas";
20-
import { fetchingEnvironmentConfigs } from "ee/actions/environmentAction";
2119
import { getWorkspaceFromId } from "ee/selectors/workspaceSelectors";
2220
import { fetchAllWorkspaces } from "ee/actions/workspaceActions";
2321

@@ -51,18 +49,6 @@ export default class WorkspaceEditorEngine {
5149
ReduxActionErrorTypes.FETCH_WORKSPACES_ERROR,
5250
]);
5351
}
54-
55-
// Fetch environment configs for the workspace
56-
yield put(
57-
fetchingEnvironmentConfigs({
58-
workspaceId,
59-
editorId: workspaceId,
60-
fetchDatasourceMeta: true,
61-
}),
62-
);
63-
64-
// Wait for environments to be fetched
65-
yield call(waitForFetchEnvironments);
6652
}
6753

6854
public *setupEngine() {

0 commit comments

Comments
 (0)