rez_core 3.1.188 → 3.1.190

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": "3.1.188",
3
+ "version": "3.1.190",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -42,8 +42,10 @@ export class ModuleAccessController {
42
42
 
43
43
  @Get('modules')
44
44
  async getModules(@Query('appcode') appcode: string, @Request() req) {
45
+ const loggedInUser = req.user.userData;
45
46
  return this.moduleAccessService.getModules({
46
47
  appcode,
48
+ loggedInUser
47
49
  });
48
50
  }
49
51
 
@@ -58,10 +58,23 @@ export class ModuleAccessRepository {
58
58
  }));
59
59
  }
60
60
 
61
- async getModules({ appcode }: { appcode: string }) {
62
- const modules = await this.moduleRepo.find({
63
- where: { module_level: 'MAINMOD', appcode },
64
- });
61
+ async getModules({
62
+ appcode,
63
+ loggedInUser,
64
+ }: {
65
+ appcode: string;
66
+ loggedInUser: any;
67
+ }) {
68
+ let modules: any[];
69
+ if (loggedInUser.level_type == 'SCH') {
70
+ modules = await this.moduleRepo.find({
71
+ where: { module_level: 'MAINMOD', appcode, level_type: 'SCH' },
72
+ });
73
+ } else {
74
+ modules = await this.moduleRepo.find({
75
+ where: { module_level: 'MAINMOD', appcode },
76
+ });
77
+ }
65
78
 
66
79
  return modules
67
80
  .map((mod) => ({
@@ -22,9 +22,9 @@ export class ModuleAccessService {
22
22
  private readonly listMasterService: ListMasterService,
23
23
  ) {}
24
24
 
25
- async getModules({ appcode }: { appcode: string }) {
25
+ async getModules({ appcode,loggedInUser }: { appcode: string ,loggedInUser: UserData}) {
26
26
  return this.moduleAccessRepository.getModules({
27
- appcode,
27
+ appcode,loggedInUser
28
28
  });
29
29
  }
30
30