Skip to content

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

Only list quick project action if current user can edit project

天舟29dc50221366
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index c2d22558c4..c6cf1ed64b 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -412,12 +412,26 @@ const routes: Array<RouteRecordRaw> = [
idFromSlug(slug)
);
- const actionList: string[] = [
- "quickaction.bb.database.schema.update",
- "quickaction.bb.database.create",
- ];
-
if (project.rowStatus == "NORMAL") {
+ const currentUser = store.getters["auth/currentUser"]();
+ let allowEditProject = false;
+ if (isDBAOrOwner(currentUser.role)) {
+ allowEditProject = true;
+ } else {
+ for (const member of project.memberList) {
+ if (member.principal.id == currentUser.id) {
+ allowEditProject = true;
+ break;
+ }
+ }
+ }
+
+ const actionList: string[] = allowEditProject
+ ? [
+ "quickaction.bb.database.schema.update",
+ "quickaction.bb.database.create",
+ ]
+ : [];
return new Map([
["OWNER", actionList],
["DBA", actionList],