bruce-models 0.3.6 → 0.3.7

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.
@@ -5044,14 +5044,23 @@ var Session;
5044
5044
  throw ("Perm is required.");
5045
5045
  }
5046
5046
  perm = perm.toLocaleUpperCase();
5047
- var group = (_b = (_a = session === null || session === void 0 ? void 0 : session.User) === null || _a === void 0 ? void 0 : _a.AccessPermissions) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x["ClientAccount.ID"] == accountId; });
5048
- if (!group) {
5047
+ var perms = (_b = (_a = session === null || session === void 0 ? void 0 : session.User) === null || _a === void 0 ? void 0 : _a.AccessPermissions) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x["ClientAccount.ID"] == accountId; });
5048
+ if (!perms) {
5049
5049
  return false;
5050
5050
  }
5051
- if (!group.EnabledFeatures) {
5052
- group.EnabledFeatures = [];
5051
+ if (!perms.UserGroups) {
5052
+ perms.UserGroups = [];
5053
5053
  }
5054
- return group.EnabledFeatures.findIndex(function (x) { return x.toLocaleUpperCase() == perm; }) > -1;
5054
+ for (var i = 0; i < perms.UserGroups.length; i++) {
5055
+ var group = perms.UserGroups[i];
5056
+ if (typeof group != "string") {
5057
+ var features = group.Features;
5058
+ if (features && features.findIndex(function (x) { return x.toLocaleUpperCase() == perm; }) > -1) {
5059
+ return true;
5060
+ }
5061
+ }
5062
+ }
5063
+ return false;
5055
5064
  }
5056
5065
  Session.IsPermEnabled = IsPermEnabled;
5057
5066
  function IsSuperPermEnabled(session, perm) {