Skip to content

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

Only show archive page for DBA role

天舟7a60727486b3
diff --git a/frontend/src/layouts/BodyLayout.vue b/frontend/src/layouts/BodyLayout.vue
index ec7a8882e7..7443822dc9 100644
--- a/frontend/src/layouts/BodyLayout.vue
+++ b/frontend/src/layouts/BodyLayout.vue
@@ -40,6 +40,7 @@
<router-view name="leftSidebar" />
</div>
<router-link
+ v-if="isCurrentUserDBA"
to="/archive"
class="outline-item group flex items-center px-4 py-2"
>
@@ -99,6 +100,7 @@
<router-view name="leftSidebar" />
</div>
<router-link
+ v-if="isCurrentUserDBA"
to="/archive"
class="outline-item group flex items-center px-4 py-2"
>
@@ -239,8 +241,10 @@ export default {
showMobileOverlay: false,
});
+ const currentUser = computed(() => store.getters["auth/currentUser"]());
+
const quickActionList = computed(() => {
- const role = store.getters["auth/currentUser"]().role;
+ const role = currentUser.value.role;
const listByRole = router.currentRoute.value.meta.quickActionListByRole;
const list: QuickActionType[] = [];
@@ -278,6 +282,10 @@ export default {
return list;
});
+ const isCurrentUserDBA = computed((): boolean => {
+ return isDBA(currentUser.value.role);
+ });
+
const showBreadcrumb = computed(() => {
const name = router.currentRoute.value.name;
return !(name === "workspace.home" || name === "workspace.profile");
@@ -290,6 +298,7 @@ export default {
return {
state,
quickActionList,
+ isCurrentUserDBA,
showBreadcrumb,
showIntro,
};
diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts
index 4c77cbf6ea..60fed39da2 100644
--- a/frontend/src/router/index.ts
+++ b/frontend/src/router/index.ts
@@ -557,7 +557,6 @@ router.beforeEach((to, from, next) => {
to.name === "error.500" ||
to.name === "workspace.home" ||
to.name === "workspace.inbox" ||
- to.name === "workspace.archive" ||
to.name === "workspace.environment" ||
to.name === "workspace.database" ||
to.name === "workspace.database.create" ||
@@ -567,7 +566,10 @@ router.beforeEach((to, from, next) => {
return;
}
- if (to.name?.toString().startsWith("workspace.instance")) {
+ if (
+ to.name === "workspace.archive" ||
+ to.name?.toString().startsWith("workspace.instance")
+ ) {
if (isDBA(loginUser.role)) {
next();
} else {