rez_core 6.5.38 → 6.5.40
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/entity/menu.entity.d.ts +1 -0
- package/dist/module/module/entity/menu.entity.js +5 -0
- package/dist/module/module/entity/menu.entity.js.map +1 -1
- package/dist/module/module/repository/menu.repository.js +1 -0
- package/dist/module/module/repository/menu.repository.js.map +1 -1
- package/dist/module/module/repository/module-access.repository.js +8 -6
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/module/entity/menu.entity.ts +4 -0
- package/src/module/module/repository/menu.repository.ts +1 -0
- package/src/module/module/repository/module-access.repository.ts +10 -8
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Column, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
2
|
import { ModuleData } from './module.entity';
|
|
3
3
|
import { AppMaster } from 'src/module/meta/entity/app-master.entity';
|
|
4
|
+
import { Exclude } from 'class-transformer';
|
|
4
5
|
|
|
5
6
|
@Entity({ name: 'sso_menu' })
|
|
6
7
|
export class MenuData {
|
|
@@ -10,6 +11,9 @@ export class MenuData {
|
|
|
10
11
|
@Column({ type: 'varchar', length: 100, nullable: true })
|
|
11
12
|
name: string;
|
|
12
13
|
|
|
14
|
+
@Exclude()
|
|
15
|
+
module_code:string;
|
|
16
|
+
|
|
13
17
|
@Column({ type: 'int', nullable: true })
|
|
14
18
|
module_id: number
|
|
15
19
|
|
|
@@ -88,6 +88,7 @@ export class MenuRepository extends Repository<MenuData> {
|
|
|
88
88
|
.andWhere('menu.ui_visible = 1')
|
|
89
89
|
.select([
|
|
90
90
|
'menu.*',
|
|
91
|
+
'module.module_code AS module_code',
|
|
91
92
|
'module.component_name AS component',
|
|
92
93
|
'module.title AS title',
|
|
93
94
|
'module.entity_type AS entity_type',
|
|
@@ -168,8 +168,8 @@ export class ModuleAccessRepository {
|
|
|
168
168
|
|
|
169
169
|
const appMaster = await appMasterRepo.find({
|
|
170
170
|
where: {
|
|
171
|
-
code: appcode
|
|
172
|
-
}
|
|
171
|
+
code: appcode,
|
|
172
|
+
},
|
|
173
173
|
});
|
|
174
174
|
|
|
175
175
|
if (!appMaster) {
|
|
@@ -348,7 +348,7 @@ export class ModuleAccessRepository {
|
|
|
348
348
|
where: {
|
|
349
349
|
id: In(roleIds),
|
|
350
350
|
app: {
|
|
351
|
-
code: appcode
|
|
351
|
+
code: appcode,
|
|
352
352
|
},
|
|
353
353
|
},
|
|
354
354
|
select: ['id', 'code'],
|
|
@@ -358,22 +358,24 @@ export class ModuleAccessRepository {
|
|
|
358
358
|
if (!roleCodes.length) return [];
|
|
359
359
|
|
|
360
360
|
const appMasterRepo = this.reflectionHelper.getRepoService('AppMaster');
|
|
361
|
-
const appMaster =await appMasterRepo.findOne({
|
|
361
|
+
const appMaster = await appMasterRepo.findOne({
|
|
362
362
|
where: {
|
|
363
|
-
code: appcode
|
|
364
|
-
}
|
|
365
|
-
})
|
|
363
|
+
code: appcode,
|
|
364
|
+
},
|
|
365
|
+
});
|
|
366
366
|
|
|
367
367
|
// Step 2: Fetch full access data
|
|
368
368
|
const accessRecords = await this.moduleAccessRepo
|
|
369
369
|
.createQueryBuilder('access')
|
|
370
370
|
.select([
|
|
371
|
-
'access.
|
|
371
|
+
'access.module_id AS module_id',
|
|
372
|
+
'm.module_code AS module_code',
|
|
372
373
|
'access.action_type AS action_type',
|
|
373
374
|
'access.access_flag AS access_flag',
|
|
374
375
|
'access.level_type AS level_type',
|
|
375
376
|
'access.appcode AS appcode',
|
|
376
377
|
])
|
|
378
|
+
.innerJoin('sso_module', 'm', 'm.id = access.module_id')
|
|
377
379
|
.where('access.role_code IN (:...roleCodes)', { roleCodes })
|
|
378
380
|
.andWhere('access.app_id = :app_id', { app_id: appMaster.id })
|
|
379
381
|
.getRawMany();
|