Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: enable environment DML/DDL policy settings for SQL Editor Mode (#14553)

Liu Ji20d980f1b8c2
diff --git a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
index f93bda70b8..400f158116 100644
--- a/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
+++ b/frontend/src/components/EnvironmentForm/AccessControlConfigure.vue
@@ -67,10 +67,7 @@
</div>
</div>
<div
- v-if="
- databaseChangeMode === 'PIPELINE' &&
- resource.startsWith(environmentNamePrefix)
- "
+ v-if="resource.startsWith(environmentNamePrefix)"
class="flex flex-col gap-y-2"
>
<div class="textlabel flex items-center space-x-2">
@@ -117,12 +114,7 @@
import { NRadioGroup, NRadio } from "naive-ui";
import { computed, watchEffect } from "vue";
import { useI18n } from "vue-i18n";
-import {
- hasFeature,
- pushNotification,
- usePolicyV1Store,
- useAppFeature,
-} from "@/store";
+import { hasFeature, pushNotification, usePolicyV1Store } from "@/store";
import { environmentNamePrefix } from "@/store/modules/v1/common";
import {
DataSourceQueryPolicy,
@@ -140,7 +132,6 @@ const props = defineProps<{
const policyStore = usePolicyV1Store();
const { t } = useI18n();
-const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
watchEffect(async () => {
await Promise.all([
diff --git a/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue b/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
index 130a93fe56..9ceacbb31b 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ExecuteHint.vue
@@ -78,6 +78,7 @@ import {
useSQLEditorTabStore,
} from "@/store";
import type { ComposedDatabase } from "@/types";
+import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
import { extractProjectResourceName, hasWorkspacePermissionV2 } from "@/utils";
import AdminModeButton from "./AdminModeButton.vue";
@@ -101,6 +102,7 @@ const tabStore = useSQLEditorTabStore();
const disallowNavigateToConsole = useAppFeature(
"bb.feature.disallow-navigate-to-console"
);
+const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
const statement = computed(() => {
const tab = tabStore.currentTab;
@@ -124,7 +126,10 @@ const actions = computed(() => {
if (hasWorkspacePermissionV2("bb.sql.admin")) {
actions.admin = true;
}
- if (!disallowNavigateToConsole.value) {
+ if (
+ !disallowNavigateToConsole.value &&
+ databaseChangeMode.value === DatabaseChangeMode.PIPELINE
+ ) {
actions.issue = true;
}