Skip to content

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

fix: principal role (#3435)

p0ny01202b300a07
diff --git a/server/task.go b/server/task.go
index 9112b02862..2026d8c4dd 100644
--- a/server/task.go
+++ b/server/task.go
@@ -559,6 +559,9 @@ func (s *Server) canPrincipalBeAssignee(ctx context.Context, principalID int, en
if principal == nil {
return false, common.Errorf(common.NotFound, "principal not found by ID %d", principalID)
}
+ if !s.feature(api.FeatureRBAC) {
+ principal.Role = api.Owner
+ }
if principal.Role == api.Owner || principal.Role == api.DBA {
return true, nil
}
@@ -574,6 +577,9 @@ func (s *Server) canPrincipalBeAssignee(ctx context.Context, principalID int, en
if member == nil {
return false, common.Errorf(common.NotFound, "project member not found by projectID %d, principalID %d", projectID, principalID)
}
+ if !s.feature(api.FeatureRBAC) {
+ member.Role = string(api.Owner)
+ }
if member.Role == string(api.Owner) {
return true, nil
}