rez_core 2.0.74 → 2.0.76
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/filter/service/filter.service.js +1 -1
- package/dist/module/filter/service/filter.service.js.map +1 -1
- package/dist/module/user/service/user.service.js +13 -13
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/filter/service/filter.service.ts +1 -1
- package/src/module/user/service/user.service.ts +17 -19
package/package.json
CHANGED
|
@@ -192,29 +192,27 @@ export class UserService extends EntityServiceImpl {
|
|
|
192
192
|
for (const entry of userDto.access) {
|
|
193
193
|
const { id, level_type, level_ids, app_code, role_id } = entry;
|
|
194
194
|
|
|
195
|
-
if (
|
|
196
|
-
!level_type ||
|
|
197
|
-
typeof level_ids !== 'number' ||
|
|
198
|
-
!app_code ||
|
|
199
|
-
!role_id
|
|
200
|
-
) {
|
|
195
|
+
if (!level_type || !app_code || !role_id || !Array.isArray(level_ids)) {
|
|
201
196
|
throw new BadRequestException('Invalid access level entry');
|
|
202
197
|
}
|
|
203
198
|
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
199
|
+
for (const levelId of level_ids) {
|
|
200
|
+
const userRoleMapping = new UserRoleMapping(savedData.id, role_id);
|
|
201
|
+
|
|
202
|
+
if (id) {
|
|
203
|
+
userRoleMapping.id = id; // Use the existing ID if provided
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
userRoleMapping.level_type = level_type;
|
|
207
|
+
userRoleMapping.level_id = String(levelId);
|
|
208
|
+
userRoleMapping.appcode = app_code;
|
|
209
|
+
userRoleMapping.role_id = role_id;
|
|
210
|
+
userRoleMapping.organization_id =
|
|
211
|
+
loggedInUserData?.organization_id || 0;
|
|
212
|
+
insertPromises.push(
|
|
213
|
+
this.userRoleMappingService.assignUserRole(userRoleMapping),
|
|
214
|
+
);
|
|
207
215
|
}
|
|
208
|
-
|
|
209
|
-
userRoleMapping.role_id = role_id;
|
|
210
|
-
userRoleMapping.appcode = app_code;
|
|
211
|
-
userRoleMapping.level_id = String(level_ids); // level_ids is now a number
|
|
212
|
-
userRoleMapping.level_type = level_type;
|
|
213
|
-
userRoleMapping.organization_id = loggedInUserData.organization_id || 0;
|
|
214
|
-
|
|
215
|
-
insertPromises.push(
|
|
216
|
-
this.userRoleMappingService.updateAssignedRole(userRoleMapping),
|
|
217
|
-
);
|
|
218
216
|
}
|
|
219
217
|
|
|
220
218
|
try {
|