From d95b911934c59c10b671fe27e7a40bb2432a08d0 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 10 Jan 2026 12:48:15 +0800 Subject: [PATCH] Update Auth Scope Handling in User KB Collection Preparation - Added a comment to clarify that the __yao_created_by field is only set for create operations, ensuring consistency with the WithCreateScope function. - Removed the __yao_updated_by field from the auth scope, streamlining the user knowledge base collection preparation process. --- openapi/user/login.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/user/login.go b/openapi/user/login.go index a7c4dc4e..c98b99bd 100644 --- a/openapi/user/login.go +++ b/openapi/user/login.go @@ -710,12 +710,12 @@ func prepareUserKBCollection(userID, teamID, locale string) { } // Build auth scope (use __yao_ prefix for permission fields) + // Only set __yao_created_by for create operations (consistent with WithCreateScope) authScope := make(map[string]interface{}) if teamID != "" { authScope["__yao_team_id"] = teamID } authScope["__yao_created_by"] = userID - authScope["__yao_updated_by"] = userID // Create new collection for this user createParams := &kbapi.CreateCollectionParams{