Skip to content

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

fix: access not support table level for mongo (#18271)

ecmadao46fe3028be79
diff --git a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue
index 2ac836ec92..8f12d6b34d 100644
--- a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue
+++ b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/DatabaseResourceSelector.vue
@@ -318,7 +318,7 @@ onMounted(async () => {
})
);
- const newCheckedKeys = new Set(selectedKeys);
+ const newCheckedKeys = new Set<string>([]);
const newIndeterminateKeys = new Set<string>([]);
const newExpandedKeys = new Set(
// expand parents for selected keys
@@ -346,6 +346,7 @@ onMounted(async () => {
if (!checkedNode) {
continue;
}
+ newCheckedKeys.add(selectedKey);
// loop to check and expand all children
cascadeLoopTreeNode(checkedNode, (treeNode) => {
newCheckedKeys.add(treeNode.value);
diff --git a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts
index c8c4faebd9..ba37c26ac8 100644
--- a/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts
+++ b/frontend/src/components/GrantRequestPanel/DatabaseResourceForm/common.ts
@@ -6,6 +6,7 @@ import {
instanceNamePrefix,
} from "@/store/modules/v1/common";
import type { ComposedDatabase, DatabaseResource } from "@/types";
+import { Engine } from "@/types/proto-es/v1/common_pb";
import type { TableMetadata } from "@/types/proto-es/v1/database_service_pb";
import { hasSchemaProperty } from "@/utils";
@@ -118,6 +119,10 @@ export const getSchemaOrTableTreeOptions = ({
filterValueList?: string[];
includeCloumn: boolean;
}) => {
+ if (database.instanceResource.engine === Engine.MONGODB) {
+ // do not support table level select for MongoDB.
+ return [];
+ }
const dbSchemaStore = useDBSchemaV1Store();
const databaseMetadata = dbSchemaStore.getDatabaseMetadataWithoutDefault(
database.name