Skip to content

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

fix: instance role name (#13440)

boojack8e3b89e8ea56
diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.go
index 12a75ca645..cd20d25c0c 100644
--- a/backend/api/v1/instance_service.go
+++ b/backend/api/v1/instance_service.go
@@ -982,14 +982,15 @@ func convertToInstance(instance *store.InstanceMessage) (*v1pb.Instance, error)
Environment: fmt.Sprintf("environments/%s", instance.EnvironmentID),
Activation: instance.Activation,
Options: convertToInstanceOptions(instance.Options),
- Roles: convertToInstanceRoles(instance.Metadata.GetRoles()),
+ Roles: convertToInstanceRoles(instance, instance.Metadata.GetRoles()),
}, nil
}
-func convertToInstanceRoles(roles []*storepb.InstanceRole) []*v1pb.InstanceRole {
+func convertToInstanceRoles(instance *store.InstanceMessage, roles []*storepb.InstanceRole) []*v1pb.InstanceRole {
var v1Roles []*v1pb.InstanceRole
for _, role := range roles {
v1Roles = append(v1Roles, &v1pb.InstanceRole{
+ Name: fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, instance.ResourceID, common.RolePrefix, role.Name),
RoleName: role.Name,
Attribute: role.Attribute,
})
diff --git a/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue b/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
index 820f4c8e84..fd4c444531 100644
--- a/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
+++ b/frontend/src/components/CreateDatabasePrepForm/CreateDatabasePrepForm.vue
@@ -1,13 +1,12 @@
<template>
<div class="w-72 mx-auto space-y-4">
- <div class="w-full">
+ <div v-if="allowEditProject" class="w-full">
<label for="project" class="textlabel">
{{ $t("common.project") }} <span style="color: red">*</span>
</label>
<ProjectSelect
class="mt-1 !w-full"
required
- :disabled="!allowEditProject"
:project-name="state.projectName"
@update:project-name="selectProject"
/>