@resolveio/server-lib 4.0.10-newrole → 4.0.11-newrole
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 +1 -1
- package/server-app.js +5 -0
package/package.json
CHANGED
package/server-app.js
CHANGED
|
@@ -168,6 +168,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
168
168
|
user = _a.sent();
|
|
169
169
|
if (user) {
|
|
170
170
|
info.req['user'] = user.fullname;
|
|
171
|
+
info.req['user_readonly'] = user.readonly || false;
|
|
171
172
|
cb(true);
|
|
172
173
|
}
|
|
173
174
|
else {
|
|
@@ -235,6 +236,7 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
235
236
|
// Get user from token
|
|
236
237
|
ws['id_user'] = req.id_user;
|
|
237
238
|
ws['user'] = req.user;
|
|
239
|
+
ws['user_readonly'] = req.user_readonly;
|
|
238
240
|
ws['id_socket'] = uuid();
|
|
239
241
|
ws['retryCnt'] = 0;
|
|
240
242
|
// Use for keeping connection alive (ping/pong)
|
|
@@ -348,6 +350,9 @@ var ResolveIOMainServer = /** @class */ (function () {
|
|
|
348
350
|
ws.terminate();
|
|
349
351
|
}, 5000);
|
|
350
352
|
}
|
|
353
|
+
if (ws['user_readonly']) {
|
|
354
|
+
return [2 /*return*/, "continue"];
|
|
355
|
+
}
|
|
351
356
|
if (method !== 'reportBuilderGetResults' && method !== 'reportBuilderGetDistinctValue' && method !== 'reportBuilderBuildTree' && method !== 'generatePDF' && method !== 'getWOOfflineData' && method !== 'countQuery' && method !== 'countWithQuery' && method !== 'countCollectionWithQuery' && method !== 'find' && method !== 'findOne' && method !== 'findWithOptions' && method !== 'setWSAppVersion' && method !== 'getDrivers') {
|
|
352
357
|
if (common_1.getBinarySize(JSON.stringify(data)) < 200000) {
|
|
353
358
|
log_collection_1.Logs.create({
|