@optimiser/common 1.0.406 → 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 +11 -11
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -5797,26 +5797,26 @@ 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,
|
|
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
|
+
response = _d.sent();
|
|
5809
5810
|
isAllowed = false;
|
|
5810
5811
|
data = response === null || response === void 0 ? void 0 : response.data;
|
|
5811
5812
|
if (data && data.Permissions.length > 0) {
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
item = _a
|
|
5815
|
-
if (item.ModuleID.toLowerCase() == moduleData._id()) {
|
|
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
5816
|
if (item.Operations.includes(permissionType)) {
|
|
5817
5817
|
isAllowed = true;
|
|
5818
5818
|
}
|
|
5819
|
-
else if (
|
|
5819
|
+
else if (item.ModuleID == "report" && item.Operations.includes('Create-Edit')) {
|
|
5820
5820
|
isAllowed = true;
|
|
5821
5821
|
}
|
|
5822
5822
|
}
|
|
@@ -5827,7 +5827,7 @@ function CheckAccessPermissions(permissionType, objectName, msp_d, db, mdb, next
|
|
|
5827
5827
|
}
|
|
5828
5828
|
return [2 /*return*/, isAllowed];
|
|
5829
5829
|
case 2:
|
|
5830
|
-
error_9 =
|
|
5830
|
+
error_9 = _d.sent();
|
|
5831
5831
|
console.error("Internal Error in CheckAccessPermissions function : ".concat(error_9));
|
|
5832
5832
|
return [3 /*break*/, 3];
|
|
5833
5833
|
case 3: return [2 /*return*/];
|