monkey-front-core 0.0.189 → 0.0.190

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.
@@ -2214,6 +2214,23 @@ class MonkeyEcxCommonsService {
2214
2214
  const { service, type } = args;
2215
2215
  return service.hasPendencies(type);
2216
2216
  }
2217
+ allowedSecurityAccessByFeature(args) {
2218
+ if (!args) {
2219
+ return true;
2220
+ }
2221
+ const { config, feature } = args;
2222
+ try {
2223
+ if (!MonkeyEcxUtils.persistNullEmptyUndefined(feature) ||
2224
+ !MonkeyEcxUtils.persistNullEmptyUndefined(config?.program?.settings[feature])) {
2225
+ return false;
2226
+ }
2227
+ return !config?.program?.settings[feature];
2228
+ }
2229
+ catch (e) {
2230
+ // not to do
2231
+ }
2232
+ return true;
2233
+ }
2217
2234
  allowedSecurityAccessByCountry(arg) {
2218
2235
  if (!arg)
2219
2236
  return true;
@@ -2334,9 +2351,11 @@ class MonkeyEcxCommonsService {
2334
2351
  this.__tokenCredentials = this.tokenStorage.getToken();
2335
2352
  }
2336
2353
  const pend = this.allowedSecurityAccessByPendency(otherArgs?.pendency);
2354
+ const allowedByProgram = this.allowedSecurityAccessByFeature(otherArgs?.featureByProgram);
2337
2355
  if (this.allowedSecurityAccess(otherArgs?.security) &&
2338
2356
  this.allowedSecurityAccessByCountry(otherArgs?.countrySecurity) &&
2339
- !pend.hasPendencies) {
2357
+ !pend.hasPendencies &&
2358
+ allowedByProgram) {
2340
2359
  if (this.__schedule) {
2341
2360
  this.otherArgs?.schedule?.service?.removeSchedule(this.__schedule);
2342
2361
  this.__schedule = null;
@@ -2384,6 +2403,9 @@ class MonkeyEcxCommonsService {
2384
2403
  otherArgs?.callbackMain();
2385
2404
  }
2386
2405
  }
2406
+ else if (allowedByProgram) {
2407
+ this.navigateToErrorPage(404, otherArgs?.router);
2408
+ }
2387
2409
  else if (pend.hasPendencies) {
2388
2410
  this.navigateToPendencyPage(pend, otherArgs?.router);
2389
2411
  }