dattatable 2.9.33 → 2.9.35

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 (56) hide show
  1. package/build/common/installRequired.d.ts +1 -0
  2. package/build/common/installRequired.js +74 -34
  3. package/dist/dattatable.js +452 -452
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/AuditLog.html +2 -2
  7. package/docs/classes/CanvasForm.html +2 -2
  8. package/docs/classes/Comments.html +2 -2
  9. package/docs/classes/Dashboard.html +4 -4
  10. package/docs/classes/DataTable.html +3 -3
  11. package/docs/classes/Documents.html +6 -6
  12. package/docs/classes/FilterSlideout.html +2 -2
  13. package/docs/classes/Footer.html +2 -2
  14. package/docs/classes/Header.html +2 -2
  15. package/docs/classes/InstallationRequired.html +3 -2
  16. package/docs/classes/ItemForm.html +4 -4
  17. package/docs/classes/List.html +4 -4
  18. package/docs/classes/ListSecurity.html +2 -2
  19. package/docs/classes/LoadingDialog.html +2 -2
  20. package/docs/classes/Modal.html +2 -2
  21. package/docs/classes/Navigation.html +3 -3
  22. package/docs/classes/Timeout.html +2 -2
  23. package/docs/enums/ActionButtonTypes.html +2 -2
  24. package/docs/functions/formatBytes.html +1 -1
  25. package/docs/functions/formatDateValue.html +1 -1
  26. package/docs/functions/formatTimeValue.html +1 -1
  27. package/docs/functions/getContextInfo.html +1 -1
  28. package/docs/functions/getFileExt.html +1 -1
  29. package/docs/functions/waitForTheme.html +1 -1
  30. package/docs/interfaces/IAuditLogItem.html +2 -2
  31. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  32. package/docs/interfaces/IAuditLogProps.html +2 -2
  33. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  34. package/docs/interfaces/ICommentsItem.html +2 -2
  35. package/docs/interfaces/IDashboardProps.html +2 -2
  36. package/docs/interfaces/IDataTable.html +2 -2
  37. package/docs/interfaces/IDataTableProps.html +2 -2
  38. package/docs/interfaces/IDocumentsProps.html +2 -2
  39. package/docs/interfaces/IFilterItem.html +2 -2
  40. package/docs/interfaces/IFilterProps.html +2 -2
  41. package/docs/interfaces/IFooterProps.html +2 -2
  42. package/docs/interfaces/IHeaderProps.html +2 -2
  43. package/docs/interfaces/IInstallProps.html +2 -2
  44. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  45. package/docs/interfaces/IItemFormEditProps.html +2 -2
  46. package/docs/interfaces/IItemFormTab.html +2 -2
  47. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  48. package/docs/interfaces/IItemFormViewProps.html +2 -2
  49. package/docs/interfaces/IListProps.html +2 -2
  50. package/docs/interfaces/IListSecurity.html +2 -2
  51. package/docs/interfaces/IListSecurityItem.html +2 -2
  52. package/docs/interfaces/IShowDialogProps.html +2 -2
  53. package/docs/variables/DattaTable.html +1 -1
  54. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  55. package/package.json +2 -2
  56. package/pnpm-lock.yaml +7 -7
@@ -22,6 +22,7 @@ export declare class InstallationRequired {
22
22
  private static _customActionsExist;
23
23
  static get CustomActionsExist(): boolean;
24
24
  private static checkCustomActions;
25
+ private static isOwnerOrAdmin;
25
26
  private static _listsExist;
26
27
  static get ListsExist(): boolean;
27
28
  private static checkLists;
@@ -107,6 +107,37 @@ var InstallationRequired = /** @class */ (function () {
107
107
  });
108
108
  });
109
109
  };
110
+ // Determines if the user is an owner or admin
111
+ InstallationRequired.isOwnerOrAdmin = function () {
112
+ // Return a promise
113
+ return new Promise(function (resolve) {
114
+ // Get the current user
115
+ (0, gd_sprest_bs_1.Web)().CurrentUser().execute(function (user) {
116
+ // See if they are an admin
117
+ if (user.IsSiteAdmin) {
118
+ // Resolve the request
119
+ resolve(true);
120
+ }
121
+ else {
122
+ // See if the user is part of the owner's group
123
+ (0, gd_sprest_bs_1.Web)().AssociatedOwnerGroup().Users().getById(user.Id).execute(
124
+ // Is an owner
125
+ function () {
126
+ // Resolve the request
127
+ resolve(true);
128
+ },
129
+ // Not an owner
130
+ function () {
131
+ // Resolve the request
132
+ resolve(false);
133
+ });
134
+ }
135
+ }, function () {
136
+ // Resolve the request
137
+ resolve(false);
138
+ });
139
+ });
140
+ };
110
141
  Object.defineProperty(InstallationRequired, "ListsExist", {
111
142
  get: function () { return this._listsExist; },
112
143
  enumerable: false,
@@ -181,44 +212,53 @@ var InstallationRequired = /** @class */ (function () {
181
212
  // Clear the report
182
213
  this._report = [];
183
214
  // Return a promise
184
- return new Promise(function (resolve) {
185
- // Ensure this is an array
186
- var cfgs = typeof (_this._cfg.length) === "number" ? _this._cfg : [_this._cfg];
187
- // Parse the configurations
188
- gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {
189
- // Return a promise
190
- return new Promise(function (resolve) {
191
- var numbOfErrors = _this._report.length;
192
- // Check the configuration
193
- Promise.all([
194
- // Check the custom actions
195
- _this.checkCustomActions(cfg),
196
- // Check the lists
197
- _this.checkLists(cfg)
198
- ]).then(function () {
199
- // See if there are errors
200
- if (_this._report.length > numbOfErrors) {
201
- // Execute the event
202
- props.onError ? props.onError(cfg) : null;
203
- }
204
- // Execute the event and see if a promise was returned
205
- var returnVal = props.onCompleted ? props.onCompleted() : null;
206
- if (returnVal && typeof (returnVal["then"]) === "function") {
207
- // Wait for the request to complete
208
- returnVal.then(function () {
215
+ return new Promise(function (resolve, reject) {
216
+ // Ensure this is an admin or owner
217
+ _this.isOwnerOrAdmin().then(function (hasPermissions) {
218
+ // See if they are not an owner or admin
219
+ if (!hasPermissions) {
220
+ // Reject the request
221
+ reject();
222
+ return;
223
+ }
224
+ // Ensure this is an array
225
+ var cfgs = typeof (_this._cfg.length) === "number" ? _this._cfg : [_this._cfg];
226
+ // Parse the configurations
227
+ gd_sprest_bs_1.Helper.Executor(cfgs, function (cfg) {
228
+ // Return a promise
229
+ return new Promise(function (resolve) {
230
+ var numbOfErrors = _this._report.length;
231
+ // Check the configuration
232
+ Promise.all([
233
+ // Check the custom actions
234
+ _this.checkCustomActions(cfg),
235
+ // Check the lists
236
+ _this.checkLists(cfg)
237
+ ]).then(function () {
238
+ // See if there are errors
239
+ if (_this._report.length > numbOfErrors) {
240
+ // Execute the event
241
+ props.onError ? props.onError(cfg) : null;
242
+ }
243
+ // Execute the event and see if a promise was returned
244
+ var returnVal = props.onCompleted ? props.onCompleted() : null;
245
+ if (returnVal && typeof (returnVal["then"]) === "function") {
246
+ // Wait for the request to complete
247
+ returnVal.then(function () {
248
+ // Resolve the request
249
+ resolve(_this._report.length > 0);
250
+ });
251
+ }
252
+ else {
209
253
  // Resolve the request
210
254
  resolve(_this._report.length > 0);
211
- });
212
- }
213
- else {
214
- // Resolve the request
215
- resolve(_this._report.length > 0);
216
- }
255
+ }
256
+ });
217
257
  });
258
+ }).then(function () {
259
+ // Resolve the request
260
+ resolve(_this._report.length > 0);
218
261
  });
219
- }).then(function () {
220
- // Resolve the request
221
- resolve(_this._report.length > 0);
222
262
  });
223
263
  });
224
264
  };