dattatable 2.11.27 → 2.11.29

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 (69) hide show
  1. package/build/common/list.d.ts +5 -0
  2. package/build/common/list.js +38 -0
  3. package/dist/dattatable.js +848 -848
  4. package/dist/dattatable.min.js +1 -1
  5. package/docs/assets/search.js +1 -1
  6. package/docs/classes/Accordion.html +2 -2
  7. package/docs/classes/AuditLog.html +2 -2
  8. package/docs/classes/CanvasForm.html +2 -2
  9. package/docs/classes/Comments.html +2 -2
  10. package/docs/classes/Dashboard.html +4 -4
  11. package/docs/classes/DataTable.html +3 -3
  12. package/docs/classes/Documents.html +6 -6
  13. package/docs/classes/FilterSlideout.html +2 -2
  14. package/docs/classes/Footer.html +2 -2
  15. package/docs/classes/Header.html +2 -2
  16. package/docs/classes/InstallationRequired.html +2 -2
  17. package/docs/classes/ItemForm.html +4 -4
  18. package/docs/classes/List.html +10 -5
  19. package/docs/classes/ListConfig.html +2 -2
  20. package/docs/classes/ListSecurity.html +2 -2
  21. package/docs/classes/LoadingDialog.html +2 -2
  22. package/docs/classes/Modal.html +2 -2
  23. package/docs/classes/Navigation.html +3 -3
  24. package/docs/classes/Tiles.html +2 -2
  25. package/docs/classes/Timeout.html +2 -2
  26. package/docs/enums/ActionButtonTypes.html +2 -2
  27. package/docs/functions/formatBytes.html +1 -1
  28. package/docs/functions/formatDateValue.html +1 -1
  29. package/docs/functions/formatTimeValue.html +1 -1
  30. package/docs/functions/getContextInfo.html +1 -1
  31. package/docs/functions/getFileExt.html +1 -1
  32. package/docs/functions/waitForTheme.html +1 -1
  33. package/docs/interfaces/IAccordion.html +2 -2
  34. package/docs/interfaces/IAccordionProps.html +2 -2
  35. package/docs/interfaces/IAuditLogItem.html +2 -2
  36. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  37. package/docs/interfaces/IAuditLogProps.html +2 -2
  38. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  39. package/docs/interfaces/ICommentsItem.html +2 -2
  40. package/docs/interfaces/ICreateLookupData.html +2 -2
  41. package/docs/interfaces/IDashboardProps.html +2 -2
  42. package/docs/interfaces/IDataTable.html +2 -2
  43. package/docs/interfaces/IDataTableProps.html +2 -2
  44. package/docs/interfaces/IDocumentsProps.html +2 -2
  45. package/docs/interfaces/IFilterItem.html +2 -2
  46. package/docs/interfaces/IFilterProps.html +2 -2
  47. package/docs/interfaces/IFooterProps.html +2 -2
  48. package/docs/interfaces/IGenerateLookupDataProps.html +2 -2
  49. package/docs/interfaces/IHeaderProps.html +2 -2
  50. package/docs/interfaces/IInstallProps.html +2 -2
  51. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  52. package/docs/interfaces/IItemFormEditProps.html +2 -2
  53. package/docs/interfaces/IItemFormSaveProps.html +2 -2
  54. package/docs/interfaces/IItemFormTab.html +2 -2
  55. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  56. package/docs/interfaces/IItemFormViewProps.html +2 -2
  57. package/docs/interfaces/IListConfig.html +2 -2
  58. package/docs/interfaces/IListConfigProps.html +2 -2
  59. package/docs/interfaces/IListProps.html +2 -2
  60. package/docs/interfaces/IListSecurity.html +2 -2
  61. package/docs/interfaces/IListSecurityItem.html +2 -2
  62. package/docs/interfaces/ILookupData.html +2 -2
  63. package/docs/interfaces/IShowDialogProps.html +2 -2
  64. package/docs/interfaces/ITiles.html +2 -2
  65. package/docs/interfaces/ITilesProps.html +2 -2
  66. package/docs/interfaces/IValidateLookupsProps.html +2 -2
  67. package/docs/variables/DattaTable.html +1 -1
  68. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  69. package/package.json +2 -2
@@ -23,6 +23,9 @@ export declare class List<T = Types.SP.ListItem> {
23
23
  /** Public Properties */
24
24
  private _camlQuery;
25
25
  get CAMLQuery(): string;
26
+ get CanAddEditItems(): boolean;
27
+ get CanDeleteItems(): boolean;
28
+ get CanViewItems(): boolean;
26
29
  get EditForm(): import("gd-sprest-bs/src/components/components").IListFormEdit;
27
30
  get EditForms(): import("gd-sprest-bs/src/components/components").IListFormEdit[];
28
31
  private _listContentTypes;
@@ -53,6 +56,7 @@ export declare class List<T = Types.SP.ListItem> {
53
56
  private _webUrl;
54
57
  get WebUrl(): string;
55
58
  /** Private Properties */
59
+ private _basePermissions;
56
60
  private _onInitError;
57
61
  private _onInitialized?;
58
62
  private _onItemLoading?;
@@ -70,6 +74,7 @@ export declare class List<T = Types.SP.ListItem> {
70
74
  getField(name: string): any;
71
75
  getFieldById(id?: string): Types.SP.Field;
72
76
  getItem(id: number): T;
77
+ hasPermissions(permissions: number | number[]): boolean;
73
78
  private init;
74
79
  private loadItem;
75
80
  private loadItems;
@@ -38,6 +38,8 @@ var List = /** @class */ (function () {
38
38
  // Web Url
39
39
  this._webUrl = null;
40
40
  /** Private Properties */
41
+ // Base Permissions
42
+ this._basePermissions = null;
41
43
  // Error event when loading the items fail
42
44
  this._onInitError = null;
43
45
  // Event triggered when the component is initialized
@@ -109,6 +111,33 @@ var List = /** @class */ (function () {
109
111
  enumerable: false,
110
112
  configurable: true
111
113
  });
114
+ Object.defineProperty(List.prototype, "CanAddEditItems", {
115
+ // Flag to determine if the user can add/edit items to the list
116
+ get: function () {
117
+ return this.hasPermissions([
118
+ gd_sprest_bs_1.SPTypes.BasePermissionTypes.AddListItems,
119
+ gd_sprest_bs_1.SPTypes.BasePermissionTypes.EditListItems
120
+ ]);
121
+ },
122
+ enumerable: false,
123
+ configurable: true
124
+ });
125
+ Object.defineProperty(List.prototype, "CanDeleteItems", {
126
+ // Flag to determine if the user can delete items to the list
127
+ get: function () {
128
+ return this.hasPermissions(gd_sprest_bs_1.SPTypes.BasePermissionTypes.DeleteListItems);
129
+ },
130
+ enumerable: false,
131
+ configurable: true
132
+ });
133
+ Object.defineProperty(List.prototype, "CanViewItems", {
134
+ // Flag to determine if the user can view items to the list
135
+ get: function () {
136
+ return this.hasPermissions(gd_sprest_bs_1.SPTypes.BasePermissionTypes.ViewListItems);
137
+ },
138
+ enumerable: false,
139
+ configurable: true
140
+ });
112
141
  Object.defineProperty(List.prototype, "EditForm", {
113
142
  // Reference to the edit form
114
143
  get: function () { return _1.ItemForm.EditForm; },
@@ -352,6 +381,11 @@ var List = /** @class */ (function () {
352
381
  // Not found
353
382
  return null;
354
383
  };
384
+ // Determines if the user has permissions to the list
385
+ List.prototype.hasPermissions = function (permissions) {
386
+ // See if the user has permissions
387
+ return gd_sprest_bs_1.Helper.hasPermissions(this._basePermissions, permissions);
388
+ };
355
389
  // Initializes the list component
356
390
  List.prototype.init = function () {
357
391
  var _this = this;
@@ -379,6 +413,10 @@ var List = /** @class */ (function () {
379
413
  // Reject the request
380
414
  reject.apply(void 0, args);
381
415
  });
416
+ // Get the user permissions for this list
417
+ list.query({ Expand: ["EffectiveBasePermissions"] }).execute(function (list) {
418
+ _this._basePermissions = list.EffectiveBasePermissions;
419
+ });
382
420
  // Get the root folder
383
421
  list.RootFolder().execute(function (folder) {
384
422
  // Set the url