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/dist/module/module/controller/module-access.controller.d.ts +7 -1
- package/dist/module/module/repository/module-access.repository.d.ts +7 -1
- package/dist/module/module/repository/module-access.repository.js +13 -5
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/module/module/service/module-access.service.d.ts +7 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/module/repository/module-access.repository.ts +17 -8
package/package.json
CHANGED
|
@@ -291,25 +291,34 @@ export class ModuleAccessRepository {
|
|
|
291
291
|
id: In(roleIds),
|
|
292
292
|
appcode,
|
|
293
293
|
},
|
|
294
|
-
select: ['id', 'code'],
|
|
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:
|
|
302
|
-
|
|
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.
|
|
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
|
|