ecrs-auth-core 1.0.89 → 1.0.90
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/auth.service.js +10 -4
- package/package.json +1 -1
package/dist/auth.service.js
CHANGED
|
@@ -164,10 +164,6 @@ let AuthService = class AuthService {
|
|
|
164
164
|
if (!Number.isFinite(moduleId))
|
|
165
165
|
return false;
|
|
166
166
|
console.log(`🔍 Checking module access for user ID ${userId} and module ID ${moduleId}...`);
|
|
167
|
-
const access = await this.moduleAccessRepo.findOne({
|
|
168
|
-
where: { userId, moduleId, isDeleted: 0, status: 1 },
|
|
169
|
-
});
|
|
170
|
-
console.log(access);
|
|
171
167
|
const access1 = await this.moduleAccessRepo
|
|
172
168
|
.createQueryBuilder("ma")
|
|
173
169
|
.where("ma.userId = :userId", { userId })
|
|
@@ -176,6 +172,16 @@ let AuthService = class AuthService {
|
|
|
176
172
|
.andWhere("ma.isDeleted = 0")
|
|
177
173
|
.getOne();
|
|
178
174
|
console.log(access1);
|
|
175
|
+
let access;
|
|
176
|
+
try {
|
|
177
|
+
access = await this.moduleAccessRepo.findOne({
|
|
178
|
+
where: { userId, moduleId, isDeleted: 0, status: 1 },
|
|
179
|
+
});
|
|
180
|
+
console.log(access);
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
console.error(error);
|
|
184
|
+
}
|
|
179
185
|
console.log(`📊 Module access check result for user ID ${userId} and module ID ${moduleId}: ${access ? 'Allowed' : 'Denied'}`);
|
|
180
186
|
return !!access;
|
|
181
187
|
}
|