@optimiser/common 1.0.410 → 1.0.411

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.
Files changed (2) hide show
  1. package/dist/lib/utility.js +10 -10
  2. package/package.json +1 -1
@@ -5797,27 +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
+ var _a, _b, _c;
5801
5801
  return __awaiter(this, void 0, void 0, function () {
5802
- var response, isAllowed, data, _i, _c, item, error_9;
5803
- return __generator(this, function (_d) {
5804
- switch (_d.label) {
5802
+ var response, isAllowed, data, _i, _d, item, error_9;
5803
+ return __generator(this, function (_e) {
5804
+ switch (_e.label) {
5805
5805
  case 0:
5806
- _d.trys.push([0, 2, , 3]);
5806
+ _e.trys.push([0, 2, , 3]);
5807
5807
  return [4 /*yield*/, GetUserProfile(msp_d, db, mdb, next)];
5808
5808
  case 1:
5809
- response = _d.sent();
5809
+ response = _e.sent();
5810
5810
  isAllowed = false;
5811
5811
  data = response === null || response === void 0 ? void 0 : response.data;
5812
5812
  if (data && data.Permissions.length > 0) {
5813
- for (_i = 0, _c = data.Permissions; _i < _c.length; _i++) {
5814
- item = _c[_i];
5813
+ for (_i = 0, _d = data.Permissions; _i < _d.length; _i++) {
5814
+ item = _d[_i];
5815
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
  break;
5819
5819
  }
5820
- else if (item.CheckOnlyControlPanel && item.Operations.includes('Control Panel')) {
5820
+ else if (((_c = item.ModuleData) === null || _c === void 0 ? void 0 : _c.CheckOnlyControlPanel) && item.Operations.includes('Control Panel')) {
5821
5821
  isAllowed = true;
5822
5822
  break;
5823
5823
  }
@@ -5833,7 +5833,7 @@ function CheckAccessPermissions(permissionType, objectName, msp_d, db, mdb, next
5833
5833
  }
5834
5834
  return [2 /*return*/, isAllowed];
5835
5835
  case 2:
5836
- error_9 = _d.sent();
5836
+ error_9 = _e.sent();
5837
5837
  console.error("Internal Error in CheckAccessPermissions function : ".concat(error_9));
5838
5838
  return [3 /*break*/, 3];
5839
5839
  case 3: return [2 /*return*/];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimiser/common",
3
- "version": "1.0.410",
3
+ "version": "1.0.411",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {