■ ■ ■ ■ ■ ■
opencti-platform/opencti-graphql/src/resolvers/user.js
| skipped 2 lines |
3 | 3 | | import { |
4 | 4 | | addBookmark, |
5 | 5 | | addUser, |
| 6 | + | assignOrganizationToUser, |
6 | 7 | | authenticateUser, |
7 | 8 | | batchGroups, |
| 9 | + | batchOrganizations, |
8 | 10 | | batchRoleCapabilities, |
9 | 11 | | batchRoles, |
| 12 | + | batchUsers, |
10 | 13 | | bookmarks, |
11 | 14 | | deleteBookmark, |
12 | 15 | | findAll, |
| skipped 16 lines |
29 | 32 | | userAddRelation, |
30 | 33 | | userCleanContext, |
31 | 34 | | userDelete, |
| 35 | + | userDeleteOrganizationRelation, |
32 | 36 | | userEditContext, |
33 | 37 | | userEditField, |
34 | 38 | | userIdDeleteRelation, |
35 | 39 | | userRenewToken, |
36 | 40 | | userWithOrigin, |
37 | | - | batchOrganizations, |
38 | | - | assignOrganizationToUser, |
39 | | - | userDeleteOrganizationRelation, |
40 | 41 | | } from '../domain/user'; |
41 | 42 | | import { BUS_TOPICS, logApp, logAudit } from '../config/conf'; |
42 | 43 | | import passport, { PROVIDERS } from '../config/providers'; |
| skipped 12 lines |
55 | 56 | | const organizationsLoader = batchLoader(batchOrganizations); |
56 | 57 | | const rolesLoader = batchLoader(batchRoles); |
57 | 58 | | const rolesCapabilitiesLoader = batchLoader(batchRoleCapabilities); |
| 59 | + | const usersLoader = batchLoader(batchUsers); |
58 | 60 | | |
59 | 61 | | const userResolvers = { |
60 | 62 | | Query: { |
| skipped 20 lines |
81 | 83 | | userSubscriptions: (current, _, context) => getUserSubscriptions(context, context.user, current.id), |
82 | 84 | | }, |
83 | 85 | | UserSession: { |
84 | | - | user: (session, _, context) => findById(context, context.user, session.user_id), |
| 86 | + | user: (session, _, context) => usersLoader.load(session.user_id, context, context.user), |
85 | 87 | | }, |
86 | 88 | | SessionDetail: { |
87 | 89 | | ttl: (session) => fetchSessionTtl(session.id), |
| skipped 98 lines |