Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix(backend): handle role prefix in GetUsersByRoleInIAMPolicy (#18932)
p0nyf323daa0da85
diff --git a/backend/utils/member.go b/backend/utils/member.goindex d88a5bed1c..f04c249136 100644--- a/backend/utils/member.go+++ b/backend/utils/member.go@@ -32,8 +32,12 @@ func FormatGroupName(group *store.GroupMessage) string {}// GetUsersByRoleInIAMPolicy gets users in the iam policy.+// The role can be either with or without the "roles/" prefix.func GetUsersByRoleInIAMPolicy(ctx context.Context, stores *store.Store, role string, policies ...*storepb.IamPolicy) []*store.UserMessage {- roleFullName := common.FormatRole(role)+ roleFullName := role+ if !strings.HasPrefix(role, common.RolePrefix) {+ roleFullName = common.FormatRole(role)+ }var users []*store.UserMessageseen := map[string]bool{}