Skip to content

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

Only allow dba/owner to archive/restore

天舟26ac6a946019
diff --git a/frontend/src/components/EnvironmentForm.vue b/frontend/src/components/EnvironmentForm.vue
index 4df92e6d6e..7c4e60d53c 100644
--- a/frontend/src/components/EnvironmentForm.vue
+++ b/frontend/src/components/EnvironmentForm.vue
@@ -48,6 +48,7 @@
</template>
<template v-else-if="state.environment.rowStatus == 'ARCHIVED'">
<BBButtonConfirm
+ v-if="allowRestore"
:style="'RESTORE'"
:buttonText="'Restore this environment'"
:okText="'Restore'"
@@ -126,7 +127,11 @@ export default {
});
const allowArchive = computed(() => {
- return environmentList.value.length > 1;
+ return allowEdit.value && environmentList.value.length > 1;
+ });
+
+ const allowRestore = computed(() => {
+ return isDBAOrOwner(currentUser.value.role);
});
const allowEdit = computed(() => {
@@ -176,6 +181,7 @@ export default {
return {
state,
allowArchive,
+ allowRestore,
allowEdit,
valueChanged,
allowCreate,