rez_core 2.2.209 → 2.2.210
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 +0 -6
- 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 +20 -2
- package/dist/module/user/controller/login.controller.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 +2 -15
- package/src/module/user/controller/login.controller.ts +22 -2
package/package.json
CHANGED
|
@@ -149,15 +149,6 @@ 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
|
-
|
|
161
152
|
// Step 1: Resolve roles
|
|
162
153
|
const roleCodes = await this.menuRepository.resolveUserRoles(
|
|
163
154
|
userId,
|
|
@@ -166,21 +157,18 @@ export class ModuleAccessService {
|
|
|
166
157
|
level_id,
|
|
167
158
|
);
|
|
168
159
|
|
|
169
|
-
console.log(roleCodes, 'roleCodes');
|
|
170
|
-
|
|
171
160
|
if (!roleCodes || roleCodes.length === 0) {
|
|
172
161
|
return [];
|
|
173
162
|
}
|
|
174
163
|
|
|
175
164
|
const roleIds = roleCodes.map(Number);
|
|
176
|
-
|
|
165
|
+
|
|
177
166
|
// Step 2: Get full permissions
|
|
178
167
|
const allPermissions =
|
|
179
168
|
await this.moduleAccessRepository.getModuleAccessByRoles(
|
|
180
169
|
roleIds,
|
|
181
170
|
appcode,
|
|
182
171
|
);
|
|
183
|
-
console.log('step 2', allPermissions);
|
|
184
172
|
|
|
185
173
|
// Step 3: If level_type is SCH, check school status using raw query
|
|
186
174
|
if (level_type === 'SCH') {
|
|
@@ -190,7 +178,6 @@ export class ModuleAccessService {
|
|
|
190
178
|
);
|
|
191
179
|
|
|
192
180
|
const school = result?.[0];
|
|
193
|
-
console.log('step 3', school);
|
|
194
181
|
|
|
195
182
|
const resolveStatus = await this.listMasterService.getResolvedListCode(
|
|
196
183
|
STATUS_INACTIVE,
|
|
@@ -202,7 +189,7 @@ export class ModuleAccessService {
|
|
|
202
189
|
return allPermissions.filter((perm) => perm.action === 'VIEW');
|
|
203
190
|
}
|
|
204
191
|
}
|
|
205
|
-
|
|
192
|
+
|
|
206
193
|
// Step 4: Return all permissions normally
|
|
207
194
|
return allPermissions;
|
|
208
195
|
}
|
|
@@ -114,9 +114,29 @@ export class LoginController {
|
|
|
114
114
|
actualState,
|
|
115
115
|
);
|
|
116
116
|
|
|
117
|
-
return res.
|
|
117
|
+
return res.send(
|
|
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
|
+
);
|
|
118
123
|
} catch (error) {
|
|
119
|
-
return res.
|
|
124
|
+
return res.send(`
|
|
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
|
+
`);
|
|
120
140
|
}
|
|
121
141
|
}
|
|
122
142
|
|