@optimiser/common 1.0.405 → 1.0.407
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/lib/utility.js +16 -14
- package/package.json +59 -59
package/dist/lib/utility.js
CHANGED
|
@@ -5797,25 +5797,27 @@ function ValidateStateCountryField(_a) {
|
|
|
5797
5797
|
* Return: true/false
|
|
5798
5798
|
*/
|
|
5799
5799
|
function CheckAccessPermissions(permissionType, objectName, msp_d, db, mdb, next) {
|
|
5800
|
+
var _a, _b;
|
|
5800
5801
|
return __awaiter(this, void 0, void 0, function () {
|
|
5801
|
-
var response, isAllowed, data, _i,
|
|
5802
|
-
return __generator(this, function (
|
|
5803
|
-
switch (
|
|
5802
|
+
var response, isAllowed, data, _i, _c, item, error_9;
|
|
5803
|
+
return __generator(this, function (_d) {
|
|
5804
|
+
switch (_d.label) {
|
|
5804
5805
|
case 0:
|
|
5805
|
-
|
|
5806
|
+
_d.trys.push([0, 2, , 3]);
|
|
5806
5807
|
return [4 /*yield*/, GetUserProfile(msp_d, db, mdb, next)];
|
|
5807
5808
|
case 1:
|
|
5808
|
-
response =
|
|
5809
|
-
isAllowed =
|
|
5809
|
+
response = _d.sent();
|
|
5810
|
+
isAllowed = false;
|
|
5810
5811
|
data = response === null || response === void 0 ? void 0 : response.data;
|
|
5811
5812
|
if (data && data.Permissions.length > 0) {
|
|
5812
|
-
for (_i = 0,
|
|
5813
|
-
item =
|
|
5814
|
-
if (item.ModuleID.toLowerCase() == objectName.toLowerCase()) {
|
|
5815
|
-
if (
|
|
5816
|
-
isAllowed =
|
|
5817
|
-
|
|
5818
|
-
|
|
5813
|
+
for (_i = 0, _c = data.Permissions; _i < _c.length; _i++) {
|
|
5814
|
+
item = _c[_i];
|
|
5815
|
+
if (item.ModuleID.toLowerCase() == objectName.toLowerCase() || ((_b = (_a = item.ModuleData) === null || _a === void 0 ? void 0 : _a.Objects) === null || _b === void 0 ? void 0 : _b.includes(objectName))) {
|
|
5816
|
+
if (item.Operations.includes(permissionType)) {
|
|
5817
|
+
isAllowed = true;
|
|
5818
|
+
}
|
|
5819
|
+
else if (item.ModuleID == "report" && item.Operations.includes('Create-Edit')) {
|
|
5820
|
+
isAllowed = true;
|
|
5819
5821
|
}
|
|
5820
5822
|
}
|
|
5821
5823
|
}
|
|
@@ -5825,7 +5827,7 @@ function CheckAccessPermissions(permissionType, objectName, msp_d, db, mdb, next
|
|
|
5825
5827
|
}
|
|
5826
5828
|
return [2 /*return*/, isAllowed];
|
|
5827
5829
|
case 2:
|
|
5828
|
-
error_9 =
|
|
5830
|
+
error_9 = _d.sent();
|
|
5829
5831
|
console.error("Internal Error in CheckAccessPermissions function : ".concat(error_9));
|
|
5830
5832
|
return [3 /*break*/, 3];
|
|
5831
5833
|
case 3: return [2 /*return*/];
|
package/package.json
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@optimiser/common",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"compile": "tsc",
|
|
8
|
-
"push": "tsc && npm version patch -git-tag-version false && npm publish"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/*"
|
|
12
|
-
],
|
|
13
|
-
"author": "",
|
|
14
|
-
"license": "ISC",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@types/geoip-lite": "^1.4.0",
|
|
17
|
-
"@types/promise.allsettled": "^1.0.3",
|
|
18
|
-
"@types/request": "^2.48.5",
|
|
19
|
-
"@types/sanitize-html": "^2.11.0",
|
|
20
|
-
"@types/sequelize": "^4.28.9",
|
|
21
|
-
"@types/unzipper": "^0.10.3",
|
|
22
|
-
"@types/uuid": "^8.3.0",
|
|
23
|
-
"aws-sdk": "^2.786.0",
|
|
24
|
-
"axios": "^0.21.4",
|
|
25
|
-
"bson": "^4.2.0",
|
|
26
|
-
"exceljs": "^4.3.0",
|
|
27
|
-
"express": "^4.17.1",
|
|
28
|
-
"express-validator": "^6.9.2",
|
|
29
|
-
"firebase-admin": "^12.0.0",
|
|
30
|
-
"geoip-lite": "^1.4.2",
|
|
31
|
-
"google-libphonenumber": "^3.2.30",
|
|
32
|
-
"ioredis": "^4.17.3",
|
|
33
|
-
"libphonenumber-js": "^1.9.51",
|
|
34
|
-
"moment": "^2.25.3",
|
|
35
|
-
"moment-timezone": "^0.5.27",
|
|
36
|
-
"mongo-sanitize": "^1.1.0",
|
|
37
|
-
"mongodb": "^3.6.2",
|
|
38
|
-
"nodemailer": "^6.4.11",
|
|
39
|
-
"promise.allsettled": "^1.0.2",
|
|
40
|
-
"qrcode": "^1.5.3",
|
|
41
|
-
"request": "^2.88.2",
|
|
42
|
-
"sanitize-html": "^2.13.0",
|
|
43
|
-
"sequelize": "^6.3.5",
|
|
44
|
-
"typescript": "^5.3.3",
|
|
45
|
-
"unzipper": "^0.10.11",
|
|
46
|
-
"uuid": "^8.3.1"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@types/aws-sdk": "^2.7.0",
|
|
50
|
-
"@types/bson": "^4.0.2",
|
|
51
|
-
"@types/exceljs": "^1.3.0",
|
|
52
|
-
"@types/express": "^4.17.8",
|
|
53
|
-
"@types/ioredis": "^4.17.4",
|
|
54
|
-
"@types/moment": "^2.13.0",
|
|
55
|
-
"@types/moment-timezone": "^0.5.30",
|
|
56
|
-
"@types/mongodb": "^3.5.27",
|
|
57
|
-
"@types/nodemailer": "^6.4.0"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@optimiser/common",
|
|
3
|
+
"version": "1.0.407",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"compile": "tsc",
|
|
8
|
+
"push": "tsc && npm version patch -git-tag-version false && npm publish"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/*"
|
|
12
|
+
],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@types/geoip-lite": "^1.4.0",
|
|
17
|
+
"@types/promise.allsettled": "^1.0.3",
|
|
18
|
+
"@types/request": "^2.48.5",
|
|
19
|
+
"@types/sanitize-html": "^2.11.0",
|
|
20
|
+
"@types/sequelize": "^4.28.9",
|
|
21
|
+
"@types/unzipper": "^0.10.3",
|
|
22
|
+
"@types/uuid": "^8.3.0",
|
|
23
|
+
"aws-sdk": "^2.786.0",
|
|
24
|
+
"axios": "^0.21.4",
|
|
25
|
+
"bson": "^4.2.0",
|
|
26
|
+
"exceljs": "^4.3.0",
|
|
27
|
+
"express": "^4.17.1",
|
|
28
|
+
"express-validator": "^6.9.2",
|
|
29
|
+
"firebase-admin": "^12.0.0",
|
|
30
|
+
"geoip-lite": "^1.4.2",
|
|
31
|
+
"google-libphonenumber": "^3.2.30",
|
|
32
|
+
"ioredis": "^4.17.3",
|
|
33
|
+
"libphonenumber-js": "^1.9.51",
|
|
34
|
+
"moment": "^2.25.3",
|
|
35
|
+
"moment-timezone": "^0.5.27",
|
|
36
|
+
"mongo-sanitize": "^1.1.0",
|
|
37
|
+
"mongodb": "^3.6.2",
|
|
38
|
+
"nodemailer": "^6.4.11",
|
|
39
|
+
"promise.allsettled": "^1.0.2",
|
|
40
|
+
"qrcode": "^1.5.3",
|
|
41
|
+
"request": "^2.88.2",
|
|
42
|
+
"sanitize-html": "^2.13.0",
|
|
43
|
+
"sequelize": "^6.3.5",
|
|
44
|
+
"typescript": "^5.3.3",
|
|
45
|
+
"unzipper": "^0.10.11",
|
|
46
|
+
"uuid": "^8.3.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/aws-sdk": "^2.7.0",
|
|
50
|
+
"@types/bson": "^4.0.2",
|
|
51
|
+
"@types/exceljs": "^1.3.0",
|
|
52
|
+
"@types/express": "^4.17.8",
|
|
53
|
+
"@types/ioredis": "^4.17.4",
|
|
54
|
+
"@types/moment": "^2.13.0",
|
|
55
|
+
"@types/moment-timezone": "^0.5.30",
|
|
56
|
+
"@types/mongodb": "^3.5.27",
|
|
57
|
+
"@types/nodemailer": "^6.4.0"
|
|
58
|
+
}
|
|
59
|
+
}
|