Shun Miyazawa пре 1 година
родитељ
комит
17b9207c3f
1 измењених фајлова са 1 додато и 0 уклоњено
  1. 1 0
      apps/app/src/features/openai/server/services/openai.ts

+ 1 - 0
apps/app/src/features/openai/server/services/openai.ts

@@ -443,6 +443,7 @@ class OpenaiService implements IOpenaiService {
       const extractedGrantedGroupIds = grantedGroups.map(group => getIdForRef(group.item).toString());
       const extractedGrantedGroupIds = grantedGroups.map(group => getIdForRef(group.item).toString());
       const extractedOwnerGroupIds = (await userGroupRelation.findAllUserGroupIdsRelatedToUser(owner)).map(group => group.toString());
       const extractedOwnerGroupIds = (await userGroupRelation.findAllUserGroupIdsRelatedToUser(owner)).map(group => group.toString());
 
 
+      // Check if the owner belongs to the group specified in grantedGroups
       const isValid = extractedGrantedGroupIds.every(groupId => extractedOwnerGroupIds.includes(groupId));
       const isValid = extractedGrantedGroupIds.every(groupId => extractedOwnerGroupIds.includes(groupId));
       if (!isValid) {
       if (!isValid) {
         throw new Error('A group to which the owner does not belong is specified.');
         throw new Error('A group to which the owner does not belong is specified.');