rez_core 2.2.210 → 2.2.211
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/service/module-access.service.js +6 -0
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/module/user/controller/login.controller.d.ts +1 -1
- package/dist/module/user/controller/login.controller.js +2 -20
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/workflow/entity/task-data.entity.d.ts +1 -0
- package/dist/module/workflow/entity/task-data.entity.js +4 -0
- package/dist/module/workflow/entity/task-data.entity.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/module/service/module-access.service.ts +15 -2
- package/src/module/user/controller/login.controller.ts +2 -22
- package/src/module/workflow/entity/task-data.entity.ts +3 -0
package/package.json
CHANGED
|
@@ -149,6 +149,15 @@ export class ModuleAccessService {
|
|
|
149
149
|
level_id: number;
|
|
150
150
|
organization_id: number;
|
|
151
151
|
}) {
|
|
152
|
+
console.log(
|
|
153
|
+
'step 1',
|
|
154
|
+
userId,
|
|
155
|
+
appcode,
|
|
156
|
+
level_type,
|
|
157
|
+
level_id,
|
|
158
|
+
organization_id,
|
|
159
|
+
);
|
|
160
|
+
|
|
152
161
|
// Step 1: Resolve roles
|
|
153
162
|
const roleCodes = await this.menuRepository.resolveUserRoles(
|
|
154
163
|
userId,
|
|
@@ -157,18 +166,21 @@ export class ModuleAccessService {
|
|
|
157
166
|
level_id,
|
|
158
167
|
);
|
|
159
168
|
|
|
169
|
+
console.log(roleCodes, 'roleCodes');
|
|
170
|
+
|
|
160
171
|
if (!roleCodes || roleCodes.length === 0) {
|
|
161
172
|
return [];
|
|
162
173
|
}
|
|
163
174
|
|
|
164
175
|
const roleIds = roleCodes.map(Number);
|
|
165
|
-
|
|
176
|
+
console.log('step 2', roleIds);
|
|
166
177
|
// Step 2: Get full permissions
|
|
167
178
|
const allPermissions =
|
|
168
179
|
await this.moduleAccessRepository.getModuleAccessByRoles(
|
|
169
180
|
roleIds,
|
|
170
181
|
appcode,
|
|
171
182
|
);
|
|
183
|
+
console.log('step 2', allPermissions);
|
|
172
184
|
|
|
173
185
|
// Step 3: If level_type is SCH, check school status using raw query
|
|
174
186
|
if (level_type === 'SCH') {
|
|
@@ -178,6 +190,7 @@ export class ModuleAccessService {
|
|
|
178
190
|
);
|
|
179
191
|
|
|
180
192
|
const school = result?.[0];
|
|
193
|
+
console.log('step 3', school);
|
|
181
194
|
|
|
182
195
|
const resolveStatus = await this.listMasterService.getResolvedListCode(
|
|
183
196
|
STATUS_INACTIVE,
|
|
@@ -189,7 +202,7 @@ export class ModuleAccessService {
|
|
|
189
202
|
return allPermissions.filter((perm) => perm.action === 'VIEW');
|
|
190
203
|
}
|
|
191
204
|
}
|
|
192
|
-
|
|
205
|
+
console.log('step 4', allPermissions);
|
|
193
206
|
// Step 4: Return all permissions normally
|
|
194
207
|
return allPermissions;
|
|
195
208
|
}
|
|
@@ -114,29 +114,9 @@ export class LoginController {
|
|
|
114
114
|
actualState,
|
|
115
115
|
);
|
|
116
116
|
|
|
117
|
-
return res.
|
|
118
|
-
`<html><body><script>
|
|
119
|
-
window.opener.postMessage({ type: 'CONFIG_SUCCESS' }, '*');
|
|
120
|
-
window.close();
|
|
121
|
-
</script> <p>Configuration successful. You can close this window.</p> </body></html>`,
|
|
122
|
-
);
|
|
117
|
+
return res.redirect(`${this.configService.get('BASE_URL')}`);
|
|
123
118
|
} catch (error) {
|
|
124
|
-
return res.
|
|
125
|
-
<html>
|
|
126
|
-
<body>
|
|
127
|
-
<script>
|
|
128
|
-
if (window.opener) {
|
|
129
|
-
window.opener.postMessage({
|
|
130
|
-
type: "CONFIG_FAILED",
|
|
131
|
-
error: "${error.message || 'Something went wrong'}"
|
|
132
|
-
}, "*");
|
|
133
|
-
}
|
|
134
|
-
window.close();
|
|
135
|
-
</script>
|
|
136
|
-
<p>Configuration failed. Please close this window.</p>
|
|
137
|
-
</body>
|
|
138
|
-
</html>
|
|
139
|
-
`);
|
|
119
|
+
return res.redirect(`${this.configService.get('BASE_URL')}`);
|
|
140
120
|
}
|
|
141
121
|
}
|
|
142
122
|
|