Skip to content

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

chore: allow owners to create user and service accounts even when self-signup is disabled (#6524)

Danny Xu97f2f3b0ff70
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 6546911c74..3dc4d56e33 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -95,7 +95,10 @@ func (s *AuthService) CreateUser(ctx context.Context, request *v1pb.CreateUserRe
}
if setting.DisallowSignup {
- return nil, status.Errorf(codes.PermissionDenied, "sign up is disallowed")
+ rolePtr := ctx.Value(common.RoleContextKey)
+ if rolePtr == nil || rolePtr.(api.Role) != api.Owner {
+ return nil, status.Errorf(codes.PermissionDenied, "sign up is disallowed")
+ }
}
if request.User == nil {
return nil, status.Errorf(codes.InvalidArgument, "user must be set")