rez_core 2.1.63 → 2.1.64
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,3 +1,4 @@
|
|
|
1
|
+
import { get } from 'http';
|
|
1
2
|
import { UserSession } from '../entity/user-session.entity';
|
|
2
3
|
import { ClockIDGenService } from '../../../utils/service/clockIDGenUtil.service';
|
|
3
4
|
import { BadRequestException, Injectable } from '@nestjs/common';
|
|
@@ -7,6 +8,7 @@ import { ConfigService } from '@nestjs/config';
|
|
|
7
8
|
import { UserRoleMappingService } from './user-role-mapping.service';
|
|
8
9
|
import { DataSource } from 'typeorm';
|
|
9
10
|
import { UserRoleMapping } from '../entity/user-role-mapping.entity';
|
|
11
|
+
import { UserData } from '../entity/user.entity';
|
|
10
12
|
|
|
11
13
|
@Injectable()
|
|
12
14
|
export class UserSessionService {
|
|
@@ -84,7 +86,19 @@ export class UserSessionService {
|
|
|
84
86
|
appcode: data.appcode,
|
|
85
87
|
};
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
let getUserDetails;
|
|
90
|
+
|
|
91
|
+
if (currentUser) {
|
|
92
|
+
// Check if user has any role mappings for the given appcode
|
|
93
|
+
getUserDetails = await this.dataSource.query(
|
|
94
|
+
`
|
|
95
|
+
SELECT * from cr_user where id = ?
|
|
96
|
+
`,
|
|
97
|
+
[currentUser.id],
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (getUserDetails.organization_id === 1 && payload.level_type === 'ORG') {
|
|
88
102
|
payload.organization_id = payload.level_id;
|
|
89
103
|
}
|
|
90
104
|
|