rez_core 2.1.12 → 2.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -291,25 +291,34 @@ export class ModuleAccessRepository {
291
291
  id: In(roleIds),
292
292
  appcode,
293
293
  },
294
- select: ['id', 'code'], // fetch only needed fields
294
+ select: ['id', 'code'],
295
295
  });
296
296
 
297
297
  const roleCodes = roles.map((r) => r.code);
298
-
299
298
  if (!roleCodes.length) return [];
300
299
 
301
- // Step 2: Use role codes to fetch access entries
302
- return this.moduleAccessRepo
300
+ // Step 2: Fetch full access data
301
+ const accessRecords = await this.moduleAccessRepo
303
302
  .createQueryBuilder('access')
304
303
  .select([
305
- 'access.module_code',
306
- 'access.action_type',
307
- 'access.access_flag',
308
- 'access.role_code',
304
+ 'access.module_code AS module_code',
305
+ 'access.action_type AS action_type',
306
+ 'access.access_flag AS access_flag',
307
+ 'access.level_type AS level_type',
308
+ 'access.appcode AS appcode',
309
309
  ])
310
310
  .where('access.role_code IN (:...roleCodes)', { roleCodes })
311
311
  .andWhere('access.appcode = :appcode', { appcode })
312
312
  .getRawMany();
313
+
314
+ // Step 3: Format output
315
+ return accessRecords.map((record) => ({
316
+ action: record.action_type,
317
+ access: record.access_flag,
318
+ code: record.module_code,
319
+ level_type: record.level_type,
320
+ appcode: record.appcode,
321
+ }));
313
322
  }
314
323
 
315
324