Selaa lähdekoodia

Add grantedUsers field to AiAssistant model for user-specific sharing

Shun Miyazawa 1 vuosi sitten
vanhempi
sitoutus
a6f79e0e7c
1 muutettua tiedostoa jossa 9 lisäystä ja 1 poistoa
  1. 9 1
      apps/app/src/features/openai/server/models/ai-assistant.ts

+ 9 - 1
apps/app/src/features/openai/server/models/ai-assistant.ts

@@ -43,7 +43,8 @@ interface AiAssistant {
   vectorStore: Ref<VectorStore>
   types: AiAssistantType[]
   owner: Ref<IUser>
-  grantedGroups?: IGrantedGroup[];
+  grantedUsers?: IUser[]
+  grantedGroups?: IGrantedGroup[]
   sharingScope: AiAssistantSharingScope
   learningScope: AiAssistantLearningScope
 }
@@ -87,6 +88,13 @@ const schema = new Schema<AiAssistantDocument>(
       ref: 'User',
       required: true,
     },
+    grantedUsers: [
+      {
+        type: Schema.Types.ObjectId,
+        ref: 'User',
+        required: true,
+      },
+    ],
     grantedGroups: {
       type: [{
         type: {