From 32d47abef236e5b885c4ecca31837c7ee4617b3d Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 6 Nov 2025 20:00:35 +0800 Subject: [PATCH] fix(api): use correct instance setting method in user registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace non-existent GetWorkspaceGeneralSetting with GetInstanceGeneralSetting to properly check if user registration is allowed. This fixes a compilation error that was preventing tests from running. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- server/router/api/v1/user_service.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/router/api/v1/user_service.go b/server/router/api/v1/user_service.go index e5de08db3..b5e452fc3 100644 --- a/server/router/api/v1/user_service.go +++ b/server/router/api/v1/user_service.go @@ -172,11 +172,11 @@ func (s *APIV1Service) CreateUser(ctx context.Context, request *v1pb.CreateUserR // Only allow user registration if it is enabled in the settings, or if the user is a superuser if currentUser == nil || !isSuperUser(currentUser) { - workspaceGeneralSetting, err := s.Store.GetWorkspaceGeneralSetting(ctx) + instanceGeneralSetting, err := s.Store.GetInstanceGeneralSetting(ctx) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get workspace general setting, error: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get instance general setting, error: %v", err) } - if workspaceGeneralSetting.DisallowUserRegistration { + if instanceGeneralSetting.DisallowUserRegistration { return nil, status.Errorf(codes.PermissionDenied, "user registration is not allowed") } }