dattatable 2.9.3 → 2.9.5
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.
- package/build/common/index.d.ts +1 -1
- package/build/common/index.js +2 -1
- package/build/common/listSecurity.d.ts +4 -3
- package/build/common/listSecurity.js +32 -65
- package/build/lib.d.ts +6 -6
- package/dist/dattatable.js +2 -2
- package/dist/dattatable.min.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AuditLog.html +13 -13
- package/docs/classes/CanvasForm.html +17 -17
- package/docs/classes/Comments.html +12 -12
- package/docs/classes/Dashboard.html +20 -20
- package/docs/classes/DataTable.html +12 -12
- package/docs/classes/Documents.html +45 -45
- package/docs/classes/FilterSlideout.html +14 -14
- package/docs/classes/Footer.html +4 -4
- package/docs/classes/Header.html +4 -4
- package/docs/classes/InstallationRequired.html +12 -12
- package/docs/classes/ItemForm.html +47 -47
- package/docs/classes/List.html +47 -47
- package/docs/classes/ListSecurity.html +54 -39
- package/docs/classes/LoadingDialog.html +12 -12
- package/docs/classes/Modal.html +26 -26
- package/docs/classes/Navigation.html +6 -6
- package/docs/classes/Timeout.html +7 -7
- package/docs/enums/ActionButtonTypes.html +6 -6
- package/docs/functions/formatBytes.html +1 -1
- package/docs/functions/formatDateValue.html +1 -1
- package/docs/functions/formatTimeValue.html +1 -1
- package/docs/functions/getFileExt.html +1 -1
- package/docs/interfaces/IAuditLogItem.html +9 -9
- package/docs/interfaces/IAuditLogItemCreation.html +7 -7
- package/docs/interfaces/IAuditLogProps.html +5 -5
- package/docs/interfaces/IAuditLogViewProps.html +6 -6
- package/docs/interfaces/ICommentsItem.html +6 -6
- package/docs/interfaces/IDashboardProps.html +14 -14
- package/docs/interfaces/IDataTable.html +8 -8
- package/docs/interfaces/IDataTableProps.html +6 -6
- package/docs/interfaces/IDocumentsProps.html +25 -25
- package/docs/interfaces/IFilterItem.html +5 -5
- package/docs/interfaces/IFilterProps.html +4 -4
- package/docs/interfaces/IFooterProps.html +6 -6
- package/docs/interfaces/IHeaderProps.html +5 -5
- package/docs/interfaces/IInstallProps.html +4 -4
- package/docs/interfaces/IItemFormCreateProps.html +14 -14
- package/docs/interfaces/IItemFormEditProps.html +15 -15
- package/docs/interfaces/IItemFormTab.html +8 -8
- package/docs/interfaces/IItemFormTabInfo.html +3 -3
- package/docs/interfaces/IItemFormViewProps.html +12 -12
- package/docs/interfaces/IListProps.html +11 -11
- package/docs/interfaces/IListSecurity.html +7 -7
- package/docs/interfaces/IListSecurityItem.html +4 -4
- package/docs/interfaces/IShowDialogProps.html +7 -7
- package/docs/variables/DattaTable.html +1 -1
- package/docs/variables/ListSecurityDefaultGroups.html +1 -1
- package/package.json +1 -1
package/build/common/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export * from "./documents";
|
|
|
5
5
|
export * from "./installRequired";
|
|
6
6
|
export * from "./itemForm";
|
|
7
7
|
export * from "./list";
|
|
8
|
-
export * from "./listSecurity";
|
|
9
8
|
export * from "./loadingDialog";
|
|
10
9
|
export * from "./methods";
|
|
11
10
|
export * from "./modal";
|
|
12
11
|
export * from "./timeout";
|
|
12
|
+
export * from "./listSecurity";
|
package/build/common/index.js
CHANGED
|
@@ -21,8 +21,9 @@ __exportStar(require("./documents"), exports);
|
|
|
21
21
|
__exportStar(require("./installRequired"), exports);
|
|
22
22
|
__exportStar(require("./itemForm"), exports);
|
|
23
23
|
__exportStar(require("./list"), exports);
|
|
24
|
-
__exportStar(require("./listSecurity"), exports);
|
|
25
24
|
__exportStar(require("./loadingDialog"), exports);
|
|
26
25
|
__exportStar(require("./methods"), exports);
|
|
27
26
|
__exportStar(require("./modal"), exports);
|
|
28
27
|
__exportStar(require("./timeout"), exports);
|
|
28
|
+
// Uses above components, so needs to be at the bottom
|
|
29
|
+
__exportStar(require("./listSecurity"), exports);
|
|
@@ -29,15 +29,16 @@ export declare class ListSecurity {
|
|
|
29
29
|
private _props;
|
|
30
30
|
private _groups;
|
|
31
31
|
getGroup(groupName: string): Types.SP.Group;
|
|
32
|
-
private
|
|
33
|
-
private
|
|
32
|
+
private setGroup;
|
|
33
|
+
private _groupUsers;
|
|
34
|
+
getGroupUsers(groupName: string): Types.SP.User[];
|
|
34
35
|
constructor(props: IListSecurity);
|
|
35
36
|
private configureList;
|
|
36
37
|
private configureLists;
|
|
37
38
|
private createGroups;
|
|
38
39
|
private getGroupId;
|
|
39
40
|
private getPermissionTypes;
|
|
40
|
-
isInGroup(userId: number, groupName: string):
|
|
41
|
+
isInGroup(userId: number, groupName: string): boolean;
|
|
41
42
|
private loadGroups;
|
|
42
43
|
private renderModal;
|
|
43
44
|
private resetPermissions;
|
|
@@ -22,6 +22,8 @@ var ListSecurity = /** @class */ (function () {
|
|
|
22
22
|
this._props = null;
|
|
23
23
|
// Security group information
|
|
24
24
|
this._groups = {};
|
|
25
|
+
// Security group users
|
|
26
|
+
this._groupUsers = {};
|
|
25
27
|
// Save the properties
|
|
26
28
|
this._props = props;
|
|
27
29
|
// Get the permission types
|
|
@@ -30,12 +32,17 @@ var ListSecurity = /** @class */ (function () {
|
|
|
30
32
|
this.loadGroups();
|
|
31
33
|
}
|
|
32
34
|
ListSecurity.prototype.getGroup = function (groupName) { return this._groups[groupName.toLowerCase()]; };
|
|
33
|
-
ListSecurity.prototype.
|
|
35
|
+
ListSecurity.prototype.setGroup = function (key, group) {
|
|
34
36
|
// Save the info
|
|
35
37
|
this._groups[key] = group;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
this._groupUsers[key] = [];
|
|
39
|
+
// See if the users exist
|
|
40
|
+
if (group.Users) {
|
|
41
|
+
// Set the users for this group
|
|
42
|
+
this._groupUsers[key] = group.Users.results || [];
|
|
43
|
+
}
|
|
38
44
|
};
|
|
45
|
+
ListSecurity.prototype.getGroupUsers = function (groupName) { return this._groupUsers[groupName.toLowerCase()] || []; };
|
|
39
46
|
// Configures a list
|
|
40
47
|
ListSecurity.prototype.configureList = function (listInfo) {
|
|
41
48
|
var _this = this;
|
|
@@ -132,7 +139,7 @@ var ListSecurity = /** @class */ (function () {
|
|
|
132
139
|
// Successfully created the group
|
|
133
140
|
function (group) {
|
|
134
141
|
// Set the group id
|
|
135
|
-
_this.
|
|
142
|
+
_this.setGroup(groupInfo.Title.toLowerCase(), group);
|
|
136
143
|
// Call the event
|
|
137
144
|
_this._props.onGroupCreated ? _this._props.onGroupCreated(group) : null;
|
|
138
145
|
// Check the next group
|
|
@@ -166,20 +173,28 @@ var ListSecurity = /** @class */ (function () {
|
|
|
166
173
|
switch (key) {
|
|
167
174
|
// Default owner's group
|
|
168
175
|
case exports.ListSecurityDefaultGroups.Owners:
|
|
169
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().
|
|
176
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().query({
|
|
177
|
+
Expand: ["Users"]
|
|
178
|
+
}).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);
|
|
170
179
|
break;
|
|
171
180
|
// Default member's group
|
|
172
181
|
case exports.ListSecurityDefaultGroups.Members:
|
|
173
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().
|
|
182
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().query({
|
|
183
|
+
Expand: ["Users"]
|
|
184
|
+
}).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);
|
|
174
185
|
break;
|
|
175
186
|
// Default visitor's group
|
|
176
187
|
case exports.ListSecurityDefaultGroups.Visitors:
|
|
177
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().
|
|
188
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().query({
|
|
189
|
+
Expand: ["Users"]
|
|
190
|
+
}).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);
|
|
178
191
|
break;
|
|
179
192
|
// Default
|
|
180
193
|
default:
|
|
181
194
|
// Get the group
|
|
182
|
-
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).
|
|
195
|
+
(0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).query({
|
|
196
|
+
Expand: ["Users"]
|
|
197
|
+
}).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);
|
|
183
198
|
break;
|
|
184
199
|
}
|
|
185
200
|
});
|
|
@@ -215,64 +230,16 @@ var ListSecurity = /** @class */ (function () {
|
|
|
215
230
|
};
|
|
216
231
|
// Method to see if a user is w/in a group
|
|
217
232
|
ListSecurity.prototype.isInGroup = function (userId, groupName) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
// See if
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
// Parse the groups
|
|
225
|
-
for (var i = 0; i < _this._users[userId].length; i++) {
|
|
226
|
-
var group = _this._users[userId][i];
|
|
227
|
-
var isInGroup_1 = false;
|
|
228
|
-
// See if this is the default owner/member/visitor group
|
|
229
|
-
switch (groupName.toLowerCase()) {
|
|
230
|
-
// Default owner's group
|
|
231
|
-
case exports.ListSecurityDefaultGroups.Owners:
|
|
232
|
-
isInGroup_1 = group.Id == _this._groups[exports.ListSecurityDefaultGroups.Owners].Id;
|
|
233
|
-
break;
|
|
234
|
-
// Default member's group
|
|
235
|
-
case exports.ListSecurityDefaultGroups.Members:
|
|
236
|
-
isInGroup_1 = group.Id == _this._groups[exports.ListSecurityDefaultGroups.Members].Id;
|
|
237
|
-
break;
|
|
238
|
-
// Default visitor's group
|
|
239
|
-
case exports.ListSecurityDefaultGroups.Visitors:
|
|
240
|
-
isInGroup_1 = group.Id == _this._groups[exports.ListSecurityDefaultGroups.Visitors].Id;
|
|
241
|
-
break;
|
|
242
|
-
// Default
|
|
243
|
-
default:
|
|
244
|
-
// See if they are in this group
|
|
245
|
-
isInGroup_1 = group.Title == groupName;
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
// See if the user is in this group
|
|
249
|
-
if (isInGroup_1) {
|
|
250
|
-
// Set the flag
|
|
251
|
-
isInGroup_1 = true;
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
// Resolve the request
|
|
256
|
-
resolve(isInGroup);
|
|
257
|
-
return;
|
|
233
|
+
// See if we have the user information
|
|
234
|
+
var users = this.getGroupUsers(groupName);
|
|
235
|
+
for (var i = 0; i < users.length; i++) {
|
|
236
|
+
// See if the user is in this group
|
|
237
|
+
if (users[i].Id == userId) {
|
|
238
|
+
return true;
|
|
258
239
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
function (groups) {
|
|
263
|
-
// Save the user information
|
|
264
|
-
_this._users[userId] = groups.results;
|
|
265
|
-
// See if they are in the group
|
|
266
|
-
_this.isInGroup(userId, groupName).then(resolve);
|
|
267
|
-
},
|
|
268
|
-
// Error
|
|
269
|
-
function () {
|
|
270
|
-
// Log
|
|
271
|
-
console.error("Unable to get the user information for id: ".concat(userId));
|
|
272
|
-
// Error get the user information
|
|
273
|
-
resolve(false);
|
|
274
|
-
});
|
|
275
|
-
});
|
|
240
|
+
}
|
|
241
|
+
// Not in the group
|
|
242
|
+
return false;
|
|
276
243
|
};
|
|
277
244
|
// Loads the security groups
|
|
278
245
|
ListSecurity.prototype.loadGroups = function () {
|
package/build/lib.d.ts
CHANGED
|
@@ -19,12 +19,6 @@ export declare const DattaTable: {
|
|
|
19
19
|
InstallationRequired: typeof Common.InstallationRequired;
|
|
20
20
|
ItemForm: typeof Common.ItemForm;
|
|
21
21
|
List: typeof Common.List;
|
|
22
|
-
ListSecurityDefaultGroups: {
|
|
23
|
-
Members: string;
|
|
24
|
-
Owners: string;
|
|
25
|
-
Visitors: string;
|
|
26
|
-
};
|
|
27
|
-
ListSecurity: typeof Common.ListSecurity;
|
|
28
22
|
LoadingDialog: typeof Common.LoadingDialog;
|
|
29
23
|
formatBytes: (bytes: number, decimals?: number) => string;
|
|
30
24
|
formatDateValue: (value: string, format?: string) => string;
|
|
@@ -32,4 +26,10 @@ export declare const DattaTable: {
|
|
|
32
26
|
getFileExt: (fileName?: string) => string;
|
|
33
27
|
Modal: typeof Common.Modal;
|
|
34
28
|
Timeout: typeof Common.Timeout;
|
|
29
|
+
ListSecurityDefaultGroups: {
|
|
30
|
+
Members: string;
|
|
31
|
+
Owners: string;
|
|
32
|
+
Visitors: string;
|
|
33
|
+
};
|
|
34
|
+
ListSecurity: typeof Common.ListSecurity;
|
|
35
35
|
};
|
package/dist/dattatable.js
CHANGED
|
@@ -71,7 +71,7 @@ eval("\r\nvar __assign = (this && this.__assign) || function () {\r\n __assig
|
|
|
71
71
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
72
72
|
|
|
73
73
|
"use strict";
|
|
74
|
-
eval("\r\n/** Common Components */\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./canvas */ \"./build/common/canvas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/common/comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/common/documents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./installRequired */ \"./build/common/installRequired.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list */ \"./build/common/list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./
|
|
74
|
+
eval("\r\n/** Common Components */\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./canvas */ \"./build/common/canvas.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./comments */ \"./build/common/comments.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./documents */ \"./build/common/documents.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./installRequired */ \"./build/common/installRequired.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./itemForm */ \"./build/common/itemForm.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./list */ \"./build/common/list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./methods */ \"./build/common/methods.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modal */ \"./build/common/modal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./timeout */ \"./build/common/timeout.js\"), exports);\r\n// Uses above components, so needs to be at the bottom\r\n__exportStar(__webpack_require__(/*! ./listSecurity */ \"./build/common/listSecurity.js\"), exports);\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/index.js?");
|
|
75
75
|
|
|
76
76
|
/***/ }),
|
|
77
77
|
|
|
@@ -115,7 +115,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
115
115
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
116
116
|
|
|
117
117
|
"use strict";
|
|
118
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ListSecurity = exports.ListSecurityDefaultGroups = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.59/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n// List Security Default Groups\r\nexports.ListSecurityDefaultGroups = {\r\n Members: \"member\",\r\n Owners: \"owner\",\r\n Visitors: \"visitor\"\r\n};\r\n/**\r\n * List Security\r\n * This component is used for setting the security group/permissions for a list.\r\n */\r\nvar ListSecurity = /** @class */ (function () {\r\n // Constructor\r\n function ListSecurity(props) {\r\n this._ddlItems = null;\r\n this._permissionTypes = null;\r\n this._props = null;\r\n // Security group information\r\n this._groups = {};\r\n // Save the properties\r\n this._props = props;\r\n // Get the permission types\r\n this.getPermissionTypes();\r\n // Load the groups\r\n this.loadGroups();\r\n }\r\n ListSecurity.prototype.getGroup = function (groupName) { return this._groups[groupName.toLowerCase()]; };\r\n ListSecurity.prototype.setGroupId = function (key, group) {\r\n // Save the info\r\n this._groups[key] = group;\r\n // Return the group id\r\n return group.Id;\r\n };\r\n // Configures a list\r\n ListSecurity.prototype.configureList = function (listInfo) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure a permission exists\r\n var permissionId = _this._permissionTypes[listInfo.permission];\r\n if (permissionId > 0) {\r\n // Get the group id\r\n _this.getGroupId(listInfo.groupName).then(\r\n // Exists\r\n function (groupId) {\r\n // Add the group to the list\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {\r\n // Log to the console\r\n console.error(\"[\".concat(listInfo.listName, \"] Error adding the group '\").concat(listInfo.groupName, \"' with permission \").concat(listInfo.permission, \" to the list.\"));\r\n // Resolve the request\r\n resolve();\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // Log to the console\r\n console.error(\"[\".concat(listInfo.listName, \"] Site Group '\").concat(listInfo.groupName, \"' doesn't exist\"));\r\n // Resolve the request\r\n resolve();\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Configures the lists\r\n ListSecurity.prototype.configureLists = function (lists) {\r\n var _this = this;\r\n var counter = 0;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Configuring Lists\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the lists are configured...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Reset the lists\r\n this.resetPermissions(lists).then(function () {\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(lists, function (list) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Configuring \".concat(++counter, \" of \").concat(lists.length, \" lists...\"));\r\n // Configure the list\r\n _this.configureList(list).then(resolve);\r\n });\r\n });\r\n });\r\n };\r\n // Creates the security groups\r\n ListSecurity.prototype.createGroups = function (createFl) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if we aren't creating the groups\r\n if (!createFl) {\r\n // Resolve the request\r\n resolve();\r\n return;\r\n }\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Ensuring the security groups exist...\");\r\n // Parse the group names\r\n var groups = _this._props.groups || [];\r\n gd_sprest_bs_1.Helper.Executor(groups, function (groupInfo) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the group\r\n _this.getGroupId(groupInfo.Title).then(\r\n // Group exists\r\n function (group) {\r\n // Check the next group\r\n resolve(group);\r\n }, \r\n // Group doesn't exist\r\n function () {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Creating the security group: \".concat(groupInfo.Title));\r\n // Create the properties\r\n var props = {\r\n Title: groupInfo.Title\r\n };\r\n // Call the event if it exists\r\n props = _this._props.onGroupCreating ? _this._props.onGroupCreating(props) : props;\r\n // Create the group\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().add(props).execute(\r\n // Successfully created the group\r\n function (group) {\r\n // Set the group id\r\n _this.setGroupId(groupInfo.Title.toLowerCase(), group);\r\n // Call the event\r\n _this._props.onGroupCreated ? _this._props.onGroupCreated(group) : null;\r\n // Check the next group\r\n resolve(group);\r\n }, \r\n // Error creating the group\r\n function () {\r\n // Log to the console\r\n console.error(\"Site Group '\".concat(groupInfo.Title, \"' was unable to be created.\"));\r\n // Check the next group\r\n resolve(null);\r\n });\r\n });\r\n });\r\n });\r\n });\r\n };\r\n // Gets the group id\r\n ListSecurity.prototype.getGroupId = function (groupName) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n var key = groupName.toLowerCase();\r\n // See if we have already have it\r\n if (_this._groups[key]) {\r\n // Resolve the request\r\n resolve(_this._groups[key].Id);\r\n return;\r\n }\r\n // Get the group information\r\n switch (key) {\r\n // Default owner's group\r\n case exports.ListSecurityDefaultGroups.Owners:\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n // Default member's group\r\n case exports.ListSecurityDefaultGroups.Members:\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n // Default visitor's group\r\n case exports.ListSecurityDefaultGroups.Visitors:\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n // Default\r\n default:\r\n // Get the group\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).execute(function (group) { resolve(_this.setGroupId(key, group)); }, reject);\r\n break;\r\n }\r\n });\r\n };\r\n // Get the permission types\r\n ListSecurity.prototype.getPermissionTypes = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the definitions\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).RoleDefinitions().query({\r\n OrderBy: [\"Name\"]\r\n }).execute(function (roleDefs) {\r\n // Clear the permissions and items\r\n _this._ddlItems = [{ text: \"No Permission\" }];\r\n _this._permissionTypes = {};\r\n // Parse the role definitions\r\n for (var i = 0; i < roleDefs.results.length; i++) {\r\n var roleDef = roleDefs.results[i];\r\n // Add the role and item\r\n var value = roleDef.RoleTypeKind > 0 ? roleDef.RoleTypeKind : roleDef.Name;\r\n _this._permissionTypes[value] = roleDef.Id;\r\n _this._ddlItems.push({\r\n data: roleDef,\r\n text: roleDef.Name,\r\n value: value.toString()\r\n });\r\n }\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Method to see if a user is w/in a group\r\n ListSecurity.prototype.isInGroup = function (userId, groupName) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // See if we have the user information\r\n if (_this._users[userId]) {\r\n var isInGroup = false;\r\n // Parse the groups\r\n for (var i = 0; i < _this._users[userId].length; i++) {\r\n var group = _this._users[userId][i];\r\n var isInGroup_1 = false;\r\n // See if this is the default owner/member/visitor group\r\n switch (groupName.toLowerCase()) {\r\n // Default owner's group\r\n case exports.ListSecurityDefaultGroups.Owners:\r\n isInGroup_1 = group.Id == _this._groups[exports.ListSecurityDefaultGroups.Owners].Id;\r\n break;\r\n // Default member's group\r\n case exports.ListSecurityDefaultGroups.Members:\r\n isInGroup_1 = group.Id == _this._groups[exports.ListSecurityDefaultGroups.Members].Id;\r\n break;\r\n // Default visitor's group\r\n case exports.ListSecurityDefaultGroups.Visitors:\r\n isInGroup_1 = group.Id == _this._groups[exports.ListSecurityDefaultGroups.Visitors].Id;\r\n break;\r\n // Default\r\n default:\r\n // See if they are in this group\r\n isInGroup_1 = group.Title == groupName;\r\n break;\r\n }\r\n // See if the user is in this group\r\n if (isInGroup_1) {\r\n // Set the flag\r\n isInGroup_1 = true;\r\n break;\r\n }\r\n }\r\n // Resolve the request\r\n resolve(isInGroup);\r\n return;\r\n }\r\n // Get the group information for this user\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteUsers(userId).Groups().execute(\r\n // Success\r\n function (groups) {\r\n // Save the user information\r\n _this._users[userId] = groups.results;\r\n // See if they are in the group\r\n _this.isInGroup(userId, groupName).then(resolve);\r\n }, \r\n // Error\r\n function () {\r\n // Log\r\n console.error(\"Unable to get the user information for id: \".concat(userId));\r\n // Error get the user information\r\n resolve(false);\r\n });\r\n });\r\n };\r\n // Loads the security groups\r\n ListSecurity.prototype.loadGroups = function () {\r\n var _this = this;\r\n // Parse the security groups\r\n gd_sprest_bs_1.Helper.Executor(this._props.groups, function (group) {\r\n // Load the group\r\n return _this.getGroupId(group.Title);\r\n }).then(function () {\r\n // Call the event\r\n _this._props.onGroupsLoaded ? _this._props.onGroupsLoaded(_this._groups) : null;\r\n });\r\n };\r\n // Render the modal\r\n ListSecurity.prototype.renderModal = function () {\r\n var _this = this;\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Set the header\r\n modal_1.Modal.setHeader(\"List Security\");\r\n // Parse the lists\r\n var rows = [];\r\n for (var i = 0; i < this._props.listItems.length; i++) {\r\n var listItem = this._props.listItems[i];\r\n // Add the row\r\n rows.push({\r\n isAutoSized: true,\r\n columns: [\r\n {\r\n control: {\r\n name: \"listName_\" + i,\r\n label: \"List Name\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Readonly,\r\n value: listItem.listName\r\n }\r\n },\r\n {\r\n control: {\r\n name: \"groupName_\" + i,\r\n label: \"Group Name\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Readonly,\r\n value: listItem.groupName\r\n }\r\n },\r\n {\r\n control: {\r\n name: \"permission_\" + i,\r\n label: \"Permission\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Dropdown,\r\n items: this._ddlItems,\r\n required: true,\r\n value: listItem.permission\r\n }\r\n }\r\n ]\r\n });\r\n }\r\n // Render the form\r\n var form = gd_sprest_bs_1.Components.Form({\r\n el: modal_1.Modal.BodyElement,\r\n rows: rows\r\n });\r\n // Render the footer\r\n gd_sprest_bs_1.Components.TooltipGroup({\r\n el: modal_1.Modal.FooterElement,\r\n tooltips: [\r\n {\r\n content: \"Closes the modal\",\r\n btnProps: {\r\n text: \"Cancel\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineDanger,\r\n onClick: function () {\r\n // Close the modal\r\n modal_1.Modal.hide();\r\n }\r\n }\r\n },\r\n {\r\n content: \"Configures the security for the lists.\",\r\n btnProps: {\r\n text: \"Configure\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n var lists = [];\r\n // Get the form values\r\n var tableData = form.getValues();\r\n // Parse the # of rows\r\n for (var i = 0; i < rows.length; i++) {\r\n // Add the list information\r\n lists.push({\r\n groupName: tableData[\"groupName_\" + i],\r\n listName: tableData[\"listName_\" + i],\r\n permission: tableData[\"permission_\" + i]\r\n });\r\n }\r\n // Configure the lists\r\n _this.configureLists(lists);\r\n }\r\n }\r\n }\r\n ]\r\n });\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n // Reset list permissions\r\n ListSecurity.prototype.resetPermissions = function (listItems) {\r\n var _this = this;\r\n // Parse the lists\r\n var lists = {};\r\n for (var i = 0; i < listItems.length; i++) {\r\n // Add the list\r\n lists[listItems[i].listName] = true;\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Parse the list keys\r\n for (var listName in lists) {\r\n var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listName);\r\n // Reset the permissions\r\n list.resetRoleInheritance().execute();\r\n // Revert to the default\r\n list.breakRoleInheritance(false, true).execute(true);\r\n // Wait for the requests to complete\r\n list.done(resolve);\r\n }\r\n });\r\n };\r\n // Shows the modal\r\n ListSecurity.prototype.show = function (createFl) {\r\n var _this = this;\r\n if (createFl === void 0) { createFl = true; }\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Loading the Security Information\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Loading the security group information...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Create the groups\r\n this.createGroups(createFl).then(function () {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Waiting for the permission types to be loaded...\");\r\n // Ensure the permissions are loaded\r\n var loopId = setInterval(function () {\r\n // See if the permissions exist\r\n if (_this._ddlItems && _this._permissionTypes) {\r\n // Hide the loading dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Show the modal\r\n _this.renderModal();\r\n // Stop the loop\r\n clearInterval(loopId);\r\n }\r\n }, 10);\r\n });\r\n };\r\n return ListSecurity;\r\n}());\r\nexports.ListSecurity = ListSecurity;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/listSecurity.js?");
|
|
118
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ListSecurity = exports.ListSecurityDefaultGroups = void 0;\r\nvar gd_sprest_bs_1 = __webpack_require__(/*! gd-sprest-bs */ \"./node_modules/.pnpm/gd-sprest-bs@10.10.59/node_modules/gd-sprest-bs/build/index.js\");\r\nvar loadingDialog_1 = __webpack_require__(/*! ./loadingDialog */ \"./build/common/loadingDialog.js\");\r\nvar modal_1 = __webpack_require__(/*! ./modal */ \"./build/common/modal.js\");\r\n// List Security Default Groups\r\nexports.ListSecurityDefaultGroups = {\r\n Members: \"member\",\r\n Owners: \"owner\",\r\n Visitors: \"visitor\"\r\n};\r\n/**\r\n * List Security\r\n * This component is used for setting the security group/permissions for a list.\r\n */\r\nvar ListSecurity = /** @class */ (function () {\r\n // Constructor\r\n function ListSecurity(props) {\r\n this._ddlItems = null;\r\n this._permissionTypes = null;\r\n this._props = null;\r\n // Security group information\r\n this._groups = {};\r\n // Security group users\r\n this._groupUsers = {};\r\n // Save the properties\r\n this._props = props;\r\n // Get the permission types\r\n this.getPermissionTypes();\r\n // Load the groups\r\n this.loadGroups();\r\n }\r\n ListSecurity.prototype.getGroup = function (groupName) { return this._groups[groupName.toLowerCase()]; };\r\n ListSecurity.prototype.setGroup = function (key, group) {\r\n // Save the info\r\n this._groups[key] = group;\r\n this._groupUsers[key] = [];\r\n // See if the users exist\r\n if (group.Users) {\r\n // Set the users for this group\r\n this._groupUsers[key] = group.Users.results || [];\r\n }\r\n };\r\n ListSecurity.prototype.getGroupUsers = function (groupName) { return this._groupUsers[groupName.toLowerCase()] || []; };\r\n // Configures a list\r\n ListSecurity.prototype.configureList = function (listInfo) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Ensure a permission exists\r\n var permissionId = _this._permissionTypes[listInfo.permission];\r\n if (permissionId > 0) {\r\n // Get the group id\r\n _this.getGroupId(listInfo.groupName).then(\r\n // Exists\r\n function (groupId) {\r\n // Add the group to the list\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {\r\n // Log to the console\r\n console.error(\"[\".concat(listInfo.listName, \"] Error adding the group '\").concat(listInfo.groupName, \"' with permission \").concat(listInfo.permission, \" to the list.\"));\r\n // Resolve the request\r\n resolve();\r\n });\r\n }, \r\n // Error\r\n function () {\r\n // Log to the console\r\n console.error(\"[\".concat(listInfo.listName, \"] Site Group '\").concat(listInfo.groupName, \"' doesn't exist\"));\r\n // Resolve the request\r\n resolve();\r\n });\r\n }\r\n else {\r\n // Resolve the request\r\n resolve();\r\n }\r\n });\r\n };\r\n // Configures the lists\r\n ListSecurity.prototype.configureLists = function (lists) {\r\n var _this = this;\r\n var counter = 0;\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Configuring Lists\");\r\n loadingDialog_1.LoadingDialog.setBody(\"This will close after the lists are configured...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Reset the lists\r\n this.resetPermissions(lists).then(function () {\r\n // Parse the lists\r\n gd_sprest_bs_1.Helper.Executor(lists, function (list) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Configuring \".concat(++counter, \" of \").concat(lists.length, \" lists...\"));\r\n // Configure the list\r\n _this.configureList(list).then(resolve);\r\n });\r\n });\r\n });\r\n };\r\n // Creates the security groups\r\n ListSecurity.prototype.createGroups = function (createFl) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n // See if we aren't creating the groups\r\n if (!createFl) {\r\n // Resolve the request\r\n resolve();\r\n return;\r\n }\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Ensuring the security groups exist...\");\r\n // Parse the group names\r\n var groups = _this._props.groups || [];\r\n gd_sprest_bs_1.Helper.Executor(groups, function (groupInfo) {\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the group\r\n _this.getGroupId(groupInfo.Title).then(\r\n // Group exists\r\n function (group) {\r\n // Check the next group\r\n resolve(group);\r\n }, \r\n // Group doesn't exist\r\n function () {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Creating the security group: \".concat(groupInfo.Title));\r\n // Create the properties\r\n var props = {\r\n Title: groupInfo.Title\r\n };\r\n // Call the event if it exists\r\n props = _this._props.onGroupCreating ? _this._props.onGroupCreating(props) : props;\r\n // Create the group\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().add(props).execute(\r\n // Successfully created the group\r\n function (group) {\r\n // Set the group id\r\n _this.setGroup(groupInfo.Title.toLowerCase(), group);\r\n // Call the event\r\n _this._props.onGroupCreated ? _this._props.onGroupCreated(group) : null;\r\n // Check the next group\r\n resolve(group);\r\n }, \r\n // Error creating the group\r\n function () {\r\n // Log to the console\r\n console.error(\"Site Group '\".concat(groupInfo.Title, \"' was unable to be created.\"));\r\n // Check the next group\r\n resolve(null);\r\n });\r\n });\r\n });\r\n });\r\n });\r\n };\r\n // Gets the group id\r\n ListSecurity.prototype.getGroupId = function (groupName) {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve, reject) {\r\n var key = groupName.toLowerCase();\r\n // See if we have already have it\r\n if (_this._groups[key]) {\r\n // Resolve the request\r\n resolve(_this._groups[key].Id);\r\n return;\r\n }\r\n // Get the group information\r\n switch (key) {\r\n // Default owner's group\r\n case exports.ListSecurityDefaultGroups.Owners:\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().query({\r\n Expand: [\"Users\"]\r\n }).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);\r\n break;\r\n // Default member's group\r\n case exports.ListSecurityDefaultGroups.Members:\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().query({\r\n Expand: [\"Users\"]\r\n }).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);\r\n break;\r\n // Default visitor's group\r\n case exports.ListSecurityDefaultGroups.Visitors:\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().query({\r\n Expand: [\"Users\"]\r\n }).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);\r\n break;\r\n // Default\r\n default:\r\n // Get the group\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).query({\r\n Expand: [\"Users\"]\r\n }).execute(function (group) { _this.setGroup(key, group); resolve(group.Id); }, reject);\r\n break;\r\n }\r\n });\r\n };\r\n // Get the permission types\r\n ListSecurity.prototype.getPermissionTypes = function () {\r\n var _this = this;\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Get the definitions\r\n (0, gd_sprest_bs_1.Web)(_this._props.webUrl).RoleDefinitions().query({\r\n OrderBy: [\"Name\"]\r\n }).execute(function (roleDefs) {\r\n // Clear the permissions and items\r\n _this._ddlItems = [{ text: \"No Permission\" }];\r\n _this._permissionTypes = {};\r\n // Parse the role definitions\r\n for (var i = 0; i < roleDefs.results.length; i++) {\r\n var roleDef = roleDefs.results[i];\r\n // Add the role and item\r\n var value = roleDef.RoleTypeKind > 0 ? roleDef.RoleTypeKind : roleDef.Name;\r\n _this._permissionTypes[value] = roleDef.Id;\r\n _this._ddlItems.push({\r\n data: roleDef,\r\n text: roleDef.Name,\r\n value: value.toString()\r\n });\r\n }\r\n // Resolve the request\r\n resolve();\r\n });\r\n });\r\n };\r\n // Method to see if a user is w/in a group\r\n ListSecurity.prototype.isInGroup = function (userId, groupName) {\r\n // See if we have the user information\r\n var users = this.getGroupUsers(groupName);\r\n for (var i = 0; i < users.length; i++) {\r\n // See if the user is in this group\r\n if (users[i].Id == userId) {\r\n return true;\r\n }\r\n }\r\n // Not in the group\r\n return false;\r\n };\r\n // Loads the security groups\r\n ListSecurity.prototype.loadGroups = function () {\r\n var _this = this;\r\n // Parse the security groups\r\n gd_sprest_bs_1.Helper.Executor(this._props.groups, function (group) {\r\n // Load the group\r\n return _this.getGroupId(group.Title);\r\n }).then(function () {\r\n // Call the event\r\n _this._props.onGroupsLoaded ? _this._props.onGroupsLoaded(_this._groups) : null;\r\n });\r\n };\r\n // Render the modal\r\n ListSecurity.prototype.renderModal = function () {\r\n var _this = this;\r\n // Clear the modal\r\n modal_1.Modal.clear();\r\n // Set the header\r\n modal_1.Modal.setHeader(\"List Security\");\r\n // Parse the lists\r\n var rows = [];\r\n for (var i = 0; i < this._props.listItems.length; i++) {\r\n var listItem = this._props.listItems[i];\r\n // Add the row\r\n rows.push({\r\n isAutoSized: true,\r\n columns: [\r\n {\r\n control: {\r\n name: \"listName_\" + i,\r\n label: \"List Name\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Readonly,\r\n value: listItem.listName\r\n }\r\n },\r\n {\r\n control: {\r\n name: \"groupName_\" + i,\r\n label: \"Group Name\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Readonly,\r\n value: listItem.groupName\r\n }\r\n },\r\n {\r\n control: {\r\n name: \"permission_\" + i,\r\n label: \"Permission\",\r\n type: gd_sprest_bs_1.Components.FormControlTypes.Dropdown,\r\n items: this._ddlItems,\r\n required: true,\r\n value: listItem.permission\r\n }\r\n }\r\n ]\r\n });\r\n }\r\n // Render the form\r\n var form = gd_sprest_bs_1.Components.Form({\r\n el: modal_1.Modal.BodyElement,\r\n rows: rows\r\n });\r\n // Render the footer\r\n gd_sprest_bs_1.Components.TooltipGroup({\r\n el: modal_1.Modal.FooterElement,\r\n tooltips: [\r\n {\r\n content: \"Closes the modal\",\r\n btnProps: {\r\n text: \"Cancel\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlineDanger,\r\n onClick: function () {\r\n // Close the modal\r\n modal_1.Modal.hide();\r\n }\r\n }\r\n },\r\n {\r\n content: \"Configures the security for the lists.\",\r\n btnProps: {\r\n text: \"Configure\",\r\n type: gd_sprest_bs_1.Components.ButtonTypes.OutlinePrimary,\r\n onClick: function () {\r\n var lists = [];\r\n // Get the form values\r\n var tableData = form.getValues();\r\n // Parse the # of rows\r\n for (var i = 0; i < rows.length; i++) {\r\n // Add the list information\r\n lists.push({\r\n groupName: tableData[\"groupName_\" + i],\r\n listName: tableData[\"listName_\" + i],\r\n permission: tableData[\"permission_\" + i]\r\n });\r\n }\r\n // Configure the lists\r\n _this.configureLists(lists);\r\n }\r\n }\r\n }\r\n ]\r\n });\r\n // Show the modal\r\n modal_1.Modal.show();\r\n };\r\n // Reset list permissions\r\n ListSecurity.prototype.resetPermissions = function (listItems) {\r\n var _this = this;\r\n // Parse the lists\r\n var lists = {};\r\n for (var i = 0; i < listItems.length; i++) {\r\n // Add the list\r\n lists[listItems[i].listName] = true;\r\n }\r\n // Return a promise\r\n return new Promise(function (resolve) {\r\n // Parse the list keys\r\n for (var listName in lists) {\r\n var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listName);\r\n // Reset the permissions\r\n list.resetRoleInheritance().execute();\r\n // Revert to the default\r\n list.breakRoleInheritance(false, true).execute(true);\r\n // Wait for the requests to complete\r\n list.done(resolve);\r\n }\r\n });\r\n };\r\n // Shows the modal\r\n ListSecurity.prototype.show = function (createFl) {\r\n var _this = this;\r\n if (createFl === void 0) { createFl = true; }\r\n // Show a loading dialog\r\n loadingDialog_1.LoadingDialog.setHeader(\"Loading the Security Information\");\r\n loadingDialog_1.LoadingDialog.setBody(\"Loading the security group information...\");\r\n loadingDialog_1.LoadingDialog.show();\r\n // Create the groups\r\n this.createGroups(createFl).then(function () {\r\n // Update the loading dialog\r\n loadingDialog_1.LoadingDialog.setBody(\"Waiting for the permission types to be loaded...\");\r\n // Ensure the permissions are loaded\r\n var loopId = setInterval(function () {\r\n // See if the permissions exist\r\n if (_this._ddlItems && _this._permissionTypes) {\r\n // Hide the loading dialog\r\n loadingDialog_1.LoadingDialog.hide();\r\n // Show the modal\r\n _this.renderModal();\r\n // Stop the loop\r\n clearInterval(loopId);\r\n }\r\n }, 10);\r\n });\r\n };\r\n return ListSecurity;\r\n}());\r\nexports.ListSecurity = ListSecurity;\r\n\n\n//# sourceURL=webpack://dattatable/./build/common/listSecurity.js?");
|
|
119
119
|
|
|
120
120
|
/***/ }),
|
|
121
121
|
|