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.
This commit is contained in:
Max 2026-01-10 12:48:15 +08:00
parent 4ba62600dc
commit d95b911934

View file

@ -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{