bruce-models 0.3.6 → 0.3.8

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.
@@ -4360,13 +4360,10 @@
4360
4360
  return __generator(this, function (_a) {
4361
4361
  switch (_a.label) {
4362
4362
  case 0:
4363
- if (!(data === null || data === void 0 ? void 0 : data.ID)) {
4364
- data.ID = exports.ObjectUtils.UId();
4365
- }
4366
4363
  if (!(data === null || data === void 0 ? void 0 : data.Title)) {
4367
4364
  data.Title = data.ID;
4368
4365
  }
4369
- return [4 /*yield*/, api.POST("ui.view/" + viewId + "/slide/" + data.ID, data, exports.Api.PrepReqParams())];
4366
+ return [4 /*yield*/, api.POST("ui.view/" + viewId + "/slide/" + (data.ID ? data.ID : ""), data, exports.Api.PrepReqParams())];
4370
4367
  case 1:
4371
4368
  data = _a.sent();
4372
4369
  api.Cache.Remove(GetCacheKey(viewId, data.ID));
@@ -4876,14 +4873,23 @@
4876
4873
  throw ("Perm is required.");
4877
4874
  }
4878
4875
  perm = perm.toLocaleUpperCase();
4879
- 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; });
4880
- if (!group) {
4876
+ 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; });
4877
+ if (!perms) {
4881
4878
  return false;
4882
4879
  }
4883
- if (!group.EnabledFeatures) {
4884
- group.EnabledFeatures = [];
4880
+ if (!perms.UserGroups) {
4881
+ perms.UserGroups = [];
4882
+ }
4883
+ for (var i = 0; i < perms.UserGroups.length; i++) {
4884
+ var group = perms.UserGroups[i];
4885
+ if (typeof group != "string") {
4886
+ var features = group.Features;
4887
+ if (features && features.findIndex(function (x) { return x.toLocaleUpperCase() == perm; }) > -1) {
4888
+ return true;
4889
+ }
4890
+ }
4885
4891
  }
4886
- return group.EnabledFeatures.findIndex(function (x) { return x.toLocaleUpperCase() == perm; }) > -1;
4892
+ return false;
4887
4893
  }
4888
4894
  Session.IsPermEnabled = IsPermEnabled;
4889
4895
  function IsSuperPermEnabled(session, perm) {