@eluvio/elv-client-js 3.2.2 → 3.2.6
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/dist/ElvClient-min.js +15 -11
- package/dist/ElvClient-node-min.js +17 -13
- package/dist/ElvFrameClient-min.js +12 -8
- package/dist/ElvPermissionsClient-min.js +13 -9
- package/dist/ElvWalletClient-min.js +58 -0
- package/dist/ElvWalletClient-node-min.js +78 -0
- package/dist/src/AuthorizationClient.js +2248 -1990
- package/dist/src/ContentObjectVerification.js +164 -173
- package/dist/src/Crypto.js +376 -324
- package/dist/src/ElvClient.js +1182 -1019
- package/dist/src/ElvWallet.js +119 -95
- package/dist/src/EthClient.js +1040 -896
- package/dist/src/FrameClient.js +331 -300
- package/dist/src/HttpClient.js +153 -147
- package/dist/src/Id.js +1 -3
- package/dist/src/PermissionsClient.js +1294 -1168
- package/dist/src/RemoteSigner.js +263 -211
- package/dist/src/UserProfileClient.js +1164 -1023
- package/dist/src/Utils.js +209 -181
- package/dist/src/client/ABRPublishing.js +895 -858
- package/dist/src/client/AccessGroups.js +1102 -959
- package/dist/src/client/ContentAccess.js +3724 -3431
- package/dist/src/client/ContentManagement.js +2252 -2068
- package/dist/src/client/Contracts.js +647 -563
- package/dist/src/client/Files.js +1886 -1757
- package/dist/src/client/NFT.js +126 -112
- package/dist/src/client/NTP.js +478 -422
- package/dist/src/walletClient/ClientMethods.js +1029 -879
- package/dist/src/walletClient/Utils.js +84 -70
- package/dist/src/walletClient/index.js +1203 -1087
- package/package.json +4 -2
- package/src/Utils.js +0 -1
- package/src/walletClient/ClientMethods.js +34 -2
- package/src/walletClient/index.js +3 -3
- package/utilities/ProductionMasterCreate.js +2 -2
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
2
|
|
|
3
|
+
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
+
|
|
3
5
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
4
6
|
|
|
5
7
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
6
8
|
|
|
7
9
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
8
10
|
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
12
|
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
14
|
|
|
13
15
|
var UrlJoin = require("url-join");
|
|
14
16
|
|
|
@@ -16,9 +18,7 @@ var _require = require("./Validation"),
|
|
|
16
18
|
ValidatePresence = _require.ValidatePresence,
|
|
17
19
|
ValidatePermission = _require.ValidatePermission;
|
|
18
20
|
|
|
19
|
-
var PermissionsClient =
|
|
20
|
-
/*#__PURE__*/
|
|
21
|
-
function () {
|
|
21
|
+
var PermissionsClient = /*#__PURE__*/function () {
|
|
22
22
|
"use strict";
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -187,7 +187,7 @@ function () {
|
|
|
187
187
|
spec.end = _this.FormatDate(permission.end);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
profileSpec[type].custom_permissions[id] = _objectSpread({}, permission,
|
|
190
|
+
profileSpec[type].custom_permissions[id] = _objectSpread(_objectSpread({}, permission), spec);
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
});
|
|
@@ -196,220 +196,224 @@ function () {
|
|
|
196
196
|
|
|
197
197
|
}, {
|
|
198
198
|
key: "FormatPermission",
|
|
199
|
-
value: function
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
case 5:
|
|
212
|
-
subjectType = "ntp";
|
|
213
|
-
subjectId = permission.subject.id;
|
|
214
|
-
return _context.abrupt("break", 20);
|
|
215
|
-
|
|
216
|
-
case 8:
|
|
217
|
-
subjectType = "ntp_subject";
|
|
218
|
-
subjectId = permission.subject.id;
|
|
219
|
-
subjectName = subjectId;
|
|
220
|
-
subjectNTPId = permission.subject.otp_id;
|
|
221
|
-
return _context.abrupt("break", 20);
|
|
222
|
-
|
|
223
|
-
case 13:
|
|
224
|
-
subjectType = "group";
|
|
225
|
-
subjectId = subjectSource === "oauth" ? permission.subject.oauth_id : this.client.utils.HashToAddress(permission.subject.id);
|
|
226
|
-
return _context.abrupt("break", 20);
|
|
227
|
-
|
|
228
|
-
case 16:
|
|
229
|
-
subjectType = "user";
|
|
230
|
-
subjectId = subjectSource === "oauth" ? permission.subject.oauth_id : this.client.utils.HashToAddress(permission.subject.id);
|
|
231
|
-
return _context.abrupt("break", 20);
|
|
232
|
-
|
|
233
|
-
case 19:
|
|
234
|
-
throw Error("Unknown subject type: " + permission.subject.type);
|
|
235
|
-
|
|
236
|
-
case 20:
|
|
237
|
-
id = permission.subject.oauth_id || permission.subject.id;
|
|
238
|
-
cachedName = this.subjectNames[id];
|
|
239
|
-
subjectName = subjectName || cachedName || permission.subject.id;
|
|
240
|
-
|
|
241
|
-
if (!(!cachedName && subjectSource === "fabric")) {
|
|
242
|
-
_context.next = 78;
|
|
199
|
+
value: function () {
|
|
200
|
+
var _FormatPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
|
|
201
|
+
var policyId, policyWriteToken, permission, subjectSource, subjectType, subjectId, subjectName, subjectNTPId, id, cachedName, contentSpaceLibraryId, permissionSpec;
|
|
202
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
203
|
+
while (1) {
|
|
204
|
+
switch (_context.prev = _context.next) {
|
|
205
|
+
case 0:
|
|
206
|
+
policyId = _ref.policyId, policyWriteToken = _ref.policyWriteToken, permission = _ref.permission;
|
|
207
|
+
subjectSource = permission.subject.type.startsWith("oauth") ? "oauth" : "fabric";
|
|
208
|
+
_context.t0 = permission.subject.type;
|
|
209
|
+
_context.next = _context.t0 === "otp" ? 5 : _context.t0 === "otp_subject" ? 8 : _context.t0 === "group" ? 13 : _context.t0 === "oauth_group" ? 13 : _context.t0 === "user" ? 16 : _context.t0 === "oauth_user" ? 16 : 19;
|
|
243
210
|
break;
|
|
244
|
-
}
|
|
245
211
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
212
|
+
case 5:
|
|
213
|
+
subjectType = "ntp";
|
|
214
|
+
subjectId = permission.subject.id;
|
|
215
|
+
return _context.abrupt("break", 20);
|
|
216
|
+
|
|
217
|
+
case 8:
|
|
218
|
+
subjectType = "ntp_subject";
|
|
219
|
+
subjectId = permission.subject.id;
|
|
220
|
+
subjectName = subjectId;
|
|
221
|
+
subjectNTPId = permission.subject.otp_id;
|
|
222
|
+
return _context.abrupt("break", 20);
|
|
223
|
+
|
|
224
|
+
case 13:
|
|
225
|
+
subjectType = "group";
|
|
226
|
+
subjectId = subjectSource === "oauth" ? permission.subject.oauth_id : this.client.utils.HashToAddress(permission.subject.id);
|
|
227
|
+
return _context.abrupt("break", 20);
|
|
228
|
+
|
|
229
|
+
case 16:
|
|
230
|
+
subjectType = "user";
|
|
231
|
+
subjectId = subjectSource === "oauth" ? permission.subject.oauth_id : this.client.utils.HashToAddress(permission.subject.id);
|
|
232
|
+
return _context.abrupt("break", 20);
|
|
233
|
+
|
|
234
|
+
case 19:
|
|
235
|
+
throw Error("Unknown subject type: " + permission.subject.type);
|
|
236
|
+
|
|
237
|
+
case 20:
|
|
238
|
+
id = permission.subject.oauth_id || permission.subject.id;
|
|
239
|
+
cachedName = this.subjectNames[id];
|
|
240
|
+
subjectName = subjectName || cachedName || permission.subject.id;
|
|
241
|
+
|
|
242
|
+
if (!(!cachedName && subjectSource === "fabric")) {
|
|
243
|
+
_context.next = 74;
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
250
246
|
|
|
251
|
-
|
|
252
|
-
|
|
247
|
+
if (!(subjectType === "group")) {
|
|
248
|
+
_context.next = 36;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
253
251
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
_context.next = 30;
|
|
257
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
258
|
-
libraryId: contentSpaceLibraryId,
|
|
259
|
-
objectId: this.client.utils.AddressToObjectId(subjectId),
|
|
260
|
-
metadataSubtree: UrlJoin("public", "name")
|
|
261
|
-
}));
|
|
252
|
+
_context.next = 27;
|
|
253
|
+
return this.client.ContentSpaceId();
|
|
262
254
|
|
|
263
|
-
|
|
264
|
-
|
|
255
|
+
case 27:
|
|
256
|
+
contentSpaceLibraryId = _context.sent.replace("ispc", "ilib");
|
|
257
|
+
_context.next = 30;
|
|
258
|
+
return this.client.ContentObjectMetadata({
|
|
259
|
+
libraryId: contentSpaceLibraryId,
|
|
260
|
+
objectId: this.client.utils.AddressToObjectId(subjectId),
|
|
261
|
+
metadataSubtree: UrlJoin("public", "name")
|
|
262
|
+
});
|
|
265
263
|
|
|
266
|
-
|
|
267
|
-
_context.
|
|
268
|
-
break;
|
|
269
|
-
}
|
|
264
|
+
case 30:
|
|
265
|
+
_context.t1 = _context.sent;
|
|
270
266
|
|
|
271
|
-
|
|
267
|
+
if (_context.t1) {
|
|
268
|
+
_context.next = 33;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
272
271
|
|
|
273
|
-
|
|
274
|
-
subjectName = _context.t1;
|
|
275
|
-
_context.next = 78;
|
|
276
|
-
break;
|
|
272
|
+
_context.t1 = subjectId;
|
|
277
273
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
_context.next =
|
|
274
|
+
case 33:
|
|
275
|
+
subjectName = _context.t1;
|
|
276
|
+
_context.next = 74;
|
|
281
277
|
break;
|
|
282
|
-
}
|
|
283
278
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}));
|
|
290
|
-
|
|
291
|
-
case 41:
|
|
292
|
-
_context.t6 = _context.sent;
|
|
293
|
-
_context.t7 = policyId;
|
|
294
|
-
_context.t8 = policyWriteToken;
|
|
295
|
-
_context.t9 = UrlJoin("auth_policy_settings", "fabric_users", subjectId);
|
|
296
|
-
_context.t10 = {
|
|
297
|
-
libraryId: _context.t6,
|
|
298
|
-
objectId: _context.t7,
|
|
299
|
-
writeToken: _context.t8,
|
|
300
|
-
metadataSubtree: _context.t9
|
|
301
|
-
};
|
|
302
|
-
_context.t11 = _context.t5.ContentObjectMetadata.call(_context.t5, _context.t10);
|
|
303
|
-
_context.next = 49;
|
|
304
|
-
return _context.t4.awrap.call(_context.t4, _context.t11);
|
|
305
|
-
|
|
306
|
-
case 49:
|
|
307
|
-
_context.t3 = _context.sent;
|
|
308
|
-
|
|
309
|
-
if (_context.t3) {
|
|
310
|
-
_context.next = 52;
|
|
311
|
-
break;
|
|
312
|
-
}
|
|
279
|
+
case 36:
|
|
280
|
+
if (!(subjectType === "user")) {
|
|
281
|
+
_context.next = 56;
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
313
284
|
|
|
314
|
-
|
|
285
|
+
_context.t4 = this.client;
|
|
286
|
+
_context.next = 40;
|
|
287
|
+
return this.client.ContentObjectLibraryId({
|
|
288
|
+
objectId: policyId
|
|
289
|
+
});
|
|
315
290
|
|
|
316
|
-
|
|
317
|
-
|
|
291
|
+
case 40:
|
|
292
|
+
_context.t5 = _context.sent;
|
|
293
|
+
_context.t6 = policyId;
|
|
294
|
+
_context.t7 = policyWriteToken;
|
|
295
|
+
_context.t8 = UrlJoin("auth_policy_settings", "fabric_users", subjectId);
|
|
296
|
+
_context.t9 = {
|
|
297
|
+
libraryId: _context.t5,
|
|
298
|
+
objectId: _context.t6,
|
|
299
|
+
writeToken: _context.t7,
|
|
300
|
+
metadataSubtree: _context.t8
|
|
301
|
+
};
|
|
302
|
+
_context.next = 47;
|
|
303
|
+
return _context.t4.ContentObjectMetadata.call(_context.t4, _context.t9);
|
|
304
|
+
|
|
305
|
+
case 47:
|
|
306
|
+
_context.t3 = _context.sent;
|
|
307
|
+
|
|
308
|
+
if (_context.t3) {
|
|
309
|
+
_context.next = 50;
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
318
312
|
|
|
319
|
-
|
|
320
|
-
_context.next = 55;
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
313
|
+
_context.t3 = {};
|
|
323
314
|
|
|
324
|
-
|
|
315
|
+
case 50:
|
|
316
|
+
_context.t2 = _context.t3.name;
|
|
325
317
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
318
|
+
if (_context.t2) {
|
|
319
|
+
_context.next = 53;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
330
322
|
|
|
331
|
-
|
|
332
|
-
if (!(subjectType === "ntp")) {
|
|
333
|
-
_context.next = 78;
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
323
|
+
_context.t2 = subjectId;
|
|
336
324
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
_context.next = 63;
|
|
340
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectLibraryId({
|
|
341
|
-
objectId: policyId
|
|
342
|
-
}));
|
|
343
|
-
|
|
344
|
-
case 63:
|
|
345
|
-
_context.t16 = _context.sent;
|
|
346
|
-
_context.t17 = policyId;
|
|
347
|
-
_context.t18 = policyWriteToken;
|
|
348
|
-
_context.t19 = UrlJoin("auth_policy_settings", "ntp_instances", subjectId);
|
|
349
|
-
_context.t20 = {
|
|
350
|
-
libraryId: _context.t16,
|
|
351
|
-
objectId: _context.t17,
|
|
352
|
-
writeToken: _context.t18,
|
|
353
|
-
metadataSubtree: _context.t19
|
|
354
|
-
};
|
|
355
|
-
_context.t21 = _context.t15.ContentObjectMetadata.call(_context.t15, _context.t20);
|
|
356
|
-
_context.next = 71;
|
|
357
|
-
return _context.t14.awrap.call(_context.t14, _context.t21);
|
|
358
|
-
|
|
359
|
-
case 71:
|
|
360
|
-
_context.t13 = _context.sent;
|
|
361
|
-
|
|
362
|
-
if (_context.t13) {
|
|
325
|
+
case 53:
|
|
326
|
+
subjectName = _context.t2;
|
|
363
327
|
_context.next = 74;
|
|
364
328
|
break;
|
|
365
|
-
}
|
|
366
329
|
|
|
367
|
-
|
|
330
|
+
case 56:
|
|
331
|
+
if (!(subjectType === "ntp")) {
|
|
332
|
+
_context.next = 74;
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
368
335
|
|
|
369
|
-
|
|
370
|
-
|
|
336
|
+
_context.t12 = this.client;
|
|
337
|
+
_context.next = 60;
|
|
338
|
+
return this.client.ContentObjectLibraryId({
|
|
339
|
+
objectId: policyId
|
|
340
|
+
});
|
|
371
341
|
|
|
372
|
-
|
|
373
|
-
_context.
|
|
374
|
-
|
|
375
|
-
|
|
342
|
+
case 60:
|
|
343
|
+
_context.t13 = _context.sent;
|
|
344
|
+
_context.t14 = policyId;
|
|
345
|
+
_context.t15 = policyWriteToken;
|
|
346
|
+
_context.t16 = UrlJoin("auth_policy_settings", "ntp_instances", subjectId);
|
|
347
|
+
_context.t17 = {
|
|
348
|
+
libraryId: _context.t13,
|
|
349
|
+
objectId: _context.t14,
|
|
350
|
+
writeToken: _context.t15,
|
|
351
|
+
metadataSubtree: _context.t16
|
|
352
|
+
};
|
|
353
|
+
_context.next = 67;
|
|
354
|
+
return _context.t12.ContentObjectMetadata.call(_context.t12, _context.t17);
|
|
355
|
+
|
|
356
|
+
case 67:
|
|
357
|
+
_context.t11 = _context.sent;
|
|
358
|
+
|
|
359
|
+
if (_context.t11) {
|
|
360
|
+
_context.next = 70;
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
376
363
|
|
|
377
|
-
|
|
364
|
+
_context.t11 = {};
|
|
378
365
|
|
|
379
|
-
|
|
380
|
-
|
|
366
|
+
case 70:
|
|
367
|
+
_context.t10 = _context.t11.name;
|
|
381
368
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
subjectSource: subjectSource,
|
|
387
|
-
subjectType: subjectType,
|
|
388
|
-
subjectId: subjectId,
|
|
389
|
-
subjectName: subjectName
|
|
390
|
-
};
|
|
369
|
+
if (_context.t10) {
|
|
370
|
+
_context.next = 73;
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
391
373
|
|
|
392
|
-
|
|
393
|
-
permissionSpec.subjectNTPId = subjectNTPId;
|
|
394
|
-
}
|
|
374
|
+
_context.t10 = subjectId;
|
|
395
375
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
376
|
+
case 73:
|
|
377
|
+
subjectName = _context.t10;
|
|
399
378
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
379
|
+
case 74:
|
|
380
|
+
this.subjectNames[id] = subjectName;
|
|
381
|
+
permissionSpec = {
|
|
382
|
+
profileName: permission.profile,
|
|
383
|
+
subjectSource: subjectSource,
|
|
384
|
+
subjectType: subjectType,
|
|
385
|
+
subjectId: subjectId,
|
|
386
|
+
subjectName: subjectName
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
if (subjectNTPId) {
|
|
390
|
+
permissionSpec.subjectNTPId = subjectNTPId;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (permission.start) {
|
|
394
|
+
permissionSpec.start = permission.start;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (permission.end) {
|
|
398
|
+
permissionSpec.end = permission.end;
|
|
399
|
+
}
|
|
403
400
|
|
|
404
|
-
|
|
401
|
+
return _context.abrupt("return", permissionSpec);
|
|
405
402
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
403
|
+
case 80:
|
|
404
|
+
case "end":
|
|
405
|
+
return _context.stop();
|
|
406
|
+
}
|
|
409
407
|
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
|
|
408
|
+
}, _callee, this);
|
|
409
|
+
}));
|
|
410
|
+
|
|
411
|
+
function FormatPermission(_x) {
|
|
412
|
+
return _FormatPermission.apply(this, arguments);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return FormatPermission;
|
|
416
|
+
}()
|
|
413
417
|
/* Offline draft */
|
|
414
418
|
|
|
415
419
|
/**
|
|
@@ -425,50 +429,58 @@ function () {
|
|
|
425
429
|
|
|
426
430
|
}, {
|
|
427
431
|
key: "OpenOfflineDraft",
|
|
428
|
-
value: function
|
|
429
|
-
var
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
432
|
+
value: function () {
|
|
433
|
+
var _OpenOfflineDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
|
|
434
|
+
var policyId, policyLibraryId, policyWriteToken, meta;
|
|
435
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
436
|
+
while (1) {
|
|
437
|
+
switch (_context2.prev = _context2.next) {
|
|
438
|
+
case 0:
|
|
439
|
+
policyId = _ref2.policyId, policyLibraryId = _ref2.policyLibraryId, policyWriteToken = _ref2.policyWriteToken;
|
|
440
|
+
|
|
441
|
+
if (!(policyLibraryId == null)) {
|
|
442
|
+
_context2.next = 5;
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
440
445
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
446
|
+
_context2.next = 4;
|
|
447
|
+
return this.client.ContentObjectLibraryId({
|
|
448
|
+
objectId: policyId
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
case 4:
|
|
452
|
+
policyLibraryId = _context2.sent;
|
|
453
|
+
|
|
454
|
+
case 5:
|
|
455
|
+
_context2.next = 7;
|
|
456
|
+
return this.client.ContentObjectMetadata({
|
|
457
|
+
libraryId: policyLibraryId,
|
|
458
|
+
objectId: policyId,
|
|
459
|
+
writeToken: policyWriteToken
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
case 7:
|
|
463
|
+
meta = _context2.sent;
|
|
464
|
+
this.drafts[policyId] = {
|
|
465
|
+
meta: meta,
|
|
466
|
+
policyLibraryId: policyLibraryId,
|
|
467
|
+
policyWriteToken: policyWriteToken
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
case 9:
|
|
471
|
+
case "end":
|
|
472
|
+
return _context2.stop();
|
|
473
|
+
}
|
|
468
474
|
}
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
|
|
475
|
+
}, _callee2, this);
|
|
476
|
+
}));
|
|
477
|
+
|
|
478
|
+
function OpenOfflineDraft(_x2) {
|
|
479
|
+
return _OpenOfflineDraft.apply(this, arguments);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
return OpenOfflineDraft;
|
|
483
|
+
}()
|
|
472
484
|
/**
|
|
473
485
|
* Close an offline draft - copies the metadata stored locally back to the write token's metadata.
|
|
474
486
|
* Does not finalize the write token.
|
|
@@ -480,40 +492,48 @@ function () {
|
|
|
480
492
|
|
|
481
493
|
}, {
|
|
482
494
|
key: "CloseOfflineDraft",
|
|
483
|
-
value: function
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
+
value: function () {
|
|
496
|
+
var _CloseOfflineDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
|
|
497
|
+
var policyId;
|
|
498
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
499
|
+
while (1) {
|
|
500
|
+
switch (_context3.prev = _context3.next) {
|
|
501
|
+
case 0:
|
|
502
|
+
policyId = _ref3.policyId;
|
|
503
|
+
|
|
504
|
+
if (!(this.drafts[policyId] == null)) {
|
|
505
|
+
_context3.next = 3;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
495
508
|
|
|
496
|
-
|
|
509
|
+
throw Error("No draft open for policyId: " + policyId);
|
|
497
510
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
511
|
+
case 3:
|
|
512
|
+
_context3.next = 5;
|
|
513
|
+
return this.client.ReplaceMetadata({
|
|
514
|
+
libraryId: this.drafts[policyId].policyLibraryId,
|
|
515
|
+
objectId: policyId,
|
|
516
|
+
writeToken: this.drafts[policyId].policyWriteToken,
|
|
517
|
+
metadata: this.drafts[policyId].meta
|
|
518
|
+
});
|
|
506
519
|
|
|
507
|
-
|
|
508
|
-
|
|
520
|
+
case 5:
|
|
521
|
+
this.drafts[policyId] = null;
|
|
509
522
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
523
|
+
case 6:
|
|
524
|
+
case "end":
|
|
525
|
+
return _context3.stop();
|
|
526
|
+
}
|
|
513
527
|
}
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
528
|
+
}, _callee3, this);
|
|
529
|
+
}));
|
|
530
|
+
|
|
531
|
+
function CloseOfflineDraft(_x3) {
|
|
532
|
+
return _CloseOfflineDraft.apply(this, arguments);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
return CloseOfflineDraft;
|
|
536
|
+
}()
|
|
517
537
|
/* Add / remove overall item permission */
|
|
518
538
|
|
|
519
539
|
/**
|
|
@@ -528,56 +548,62 @@ function () {
|
|
|
528
548
|
|
|
529
549
|
}, {
|
|
530
550
|
key: "PolicyItems",
|
|
531
|
-
value: function
|
|
532
|
-
var
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
case 5:
|
|
546
|
-
_context4.t3 = _context4.sent;
|
|
547
|
-
_context4.t4 = policyId;
|
|
548
|
-
_context4.t5 = policyWriteToken;
|
|
549
|
-
_context4.t6 = ["*/display_title"];
|
|
550
|
-
_context4.t7 = {
|
|
551
|
-
libraryId: _context4.t3,
|
|
552
|
-
objectId: _context4.t4,
|
|
553
|
-
writeToken: _context4.t5,
|
|
554
|
-
metadataSubtree: "auth_policy_spec",
|
|
555
|
-
select: _context4.t6
|
|
556
|
-
};
|
|
557
|
-
_context4.t8 = _context4.t2.ContentObjectMetadata.call(_context4.t2, _context4.t7);
|
|
558
|
-
_context4.next = 13;
|
|
559
|
-
return _context4.t1.awrap.call(_context4.t1, _context4.t8);
|
|
560
|
-
|
|
561
|
-
case 13:
|
|
562
|
-
_context4.t0 = _context4.sent;
|
|
563
|
-
|
|
564
|
-
if (_context4.t0) {
|
|
565
|
-
_context4.next = 16;
|
|
566
|
-
break;
|
|
567
|
-
}
|
|
551
|
+
value: function () {
|
|
552
|
+
var _PolicyItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
|
|
553
|
+
var policyId, policyWriteToken;
|
|
554
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
555
|
+
while (1) {
|
|
556
|
+
switch (_context4.prev = _context4.next) {
|
|
557
|
+
case 0:
|
|
558
|
+
policyId = _ref4.policyId, policyWriteToken = _ref4.policyWriteToken;
|
|
559
|
+
_context4.t1 = this.client;
|
|
560
|
+
_context4.next = 4;
|
|
561
|
+
return this.client.ContentObjectLibraryId({
|
|
562
|
+
objectId: policyId
|
|
563
|
+
});
|
|
568
564
|
|
|
569
|
-
|
|
565
|
+
case 4:
|
|
566
|
+
_context4.t2 = _context4.sent;
|
|
567
|
+
_context4.t3 = policyId;
|
|
568
|
+
_context4.t4 = policyWriteToken;
|
|
569
|
+
_context4.t5 = ["*/display_title"];
|
|
570
|
+
_context4.t6 = {
|
|
571
|
+
libraryId: _context4.t2,
|
|
572
|
+
objectId: _context4.t3,
|
|
573
|
+
writeToken: _context4.t4,
|
|
574
|
+
metadataSubtree: "auth_policy_spec",
|
|
575
|
+
select: _context4.t5
|
|
576
|
+
};
|
|
577
|
+
_context4.next = 11;
|
|
578
|
+
return _context4.t1.ContentObjectMetadata.call(_context4.t1, _context4.t6);
|
|
579
|
+
|
|
580
|
+
case 11:
|
|
581
|
+
_context4.t0 = _context4.sent;
|
|
582
|
+
|
|
583
|
+
if (_context4.t0) {
|
|
584
|
+
_context4.next = 14;
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
570
587
|
|
|
571
|
-
|
|
572
|
-
return _context4.abrupt("return", _context4.t0);
|
|
588
|
+
_context4.t0 = {};
|
|
573
589
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
590
|
+
case 14:
|
|
591
|
+
return _context4.abrupt("return", _context4.t0);
|
|
592
|
+
|
|
593
|
+
case 15:
|
|
594
|
+
case "end":
|
|
595
|
+
return _context4.stop();
|
|
596
|
+
}
|
|
577
597
|
}
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
|
|
598
|
+
}, _callee4, this);
|
|
599
|
+
}));
|
|
600
|
+
|
|
601
|
+
function PolicyItems(_x4) {
|
|
602
|
+
return _PolicyItems.apply(this, arguments);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return PolicyItems;
|
|
606
|
+
}()
|
|
581
607
|
/**
|
|
582
608
|
* Retrieve the full item policy for the given item.
|
|
583
609
|
*
|
|
@@ -591,52 +617,60 @@ function () {
|
|
|
591
617
|
|
|
592
618
|
}, {
|
|
593
619
|
key: "ItemPolicy",
|
|
594
|
-
value: function
|
|
595
|
-
var
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
case 6:
|
|
618
|
-
permissions = _context5.sent;
|
|
619
|
-
|
|
620
|
-
if (!(!profiles || !permissions)) {
|
|
621
|
-
_context5.next = 9;
|
|
622
|
-
break;
|
|
623
|
-
}
|
|
620
|
+
value: function () {
|
|
621
|
+
var _ItemPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
622
|
+
var policyId, policyWriteToken, itemId, profiles, permissions;
|
|
623
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
624
|
+
while (1) {
|
|
625
|
+
switch (_context5.prev = _context5.next) {
|
|
626
|
+
case 0:
|
|
627
|
+
policyId = _ref5.policyId, policyWriteToken = _ref5.policyWriteToken, itemId = _ref5.itemId;
|
|
628
|
+
_context5.next = 3;
|
|
629
|
+
return this.ItemProfiles({
|
|
630
|
+
policyId: policyId,
|
|
631
|
+
policyWriteToken: policyWriteToken,
|
|
632
|
+
itemId: itemId
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
case 3:
|
|
636
|
+
profiles = _context5.sent;
|
|
637
|
+
_context5.next = 6;
|
|
638
|
+
return this.ItemPermissions({
|
|
639
|
+
policyId: policyId,
|
|
640
|
+
policyWriteToken: policyWriteToken,
|
|
641
|
+
itemId: itemId
|
|
642
|
+
});
|
|
624
643
|
|
|
625
|
-
|
|
644
|
+
case 6:
|
|
645
|
+
permissions = _context5.sent;
|
|
646
|
+
|
|
647
|
+
if (!(!profiles || !permissions)) {
|
|
648
|
+
_context5.next = 9;
|
|
649
|
+
break;
|
|
650
|
+
}
|
|
626
651
|
|
|
627
|
-
|
|
628
|
-
return _context5.abrupt("return", {
|
|
629
|
-
profiles: profiles,
|
|
630
|
-
permissions: permissions
|
|
631
|
-
});
|
|
652
|
+
return _context5.abrupt("return");
|
|
632
653
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
654
|
+
case 9:
|
|
655
|
+
return _context5.abrupt("return", {
|
|
656
|
+
profiles: profiles,
|
|
657
|
+
permissions: permissions
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
case 10:
|
|
661
|
+
case "end":
|
|
662
|
+
return _context5.stop();
|
|
663
|
+
}
|
|
636
664
|
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
665
|
+
}, _callee5, this);
|
|
666
|
+
}));
|
|
667
|
+
|
|
668
|
+
function ItemPolicy(_x5) {
|
|
669
|
+
return _ItemPolicy.apply(this, arguments);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
return ItemPolicy;
|
|
673
|
+
}()
|
|
640
674
|
/**
|
|
641
675
|
* Initialize policy for the specified item
|
|
642
676
|
*
|
|
@@ -650,93 +684,97 @@ function () {
|
|
|
650
684
|
|
|
651
685
|
}, {
|
|
652
686
|
key: "CreateItemPolicy",
|
|
653
|
-
value: function
|
|
654
|
-
var
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
687
|
+
value: function () {
|
|
688
|
+
var _CreateItemPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
|
|
689
|
+
var _this2 = this;
|
|
690
|
+
|
|
691
|
+
var policyId, policyWriteToken, itemId, _ref6$profiles, profiles, metadata, assetMetadata, displayTitle, itemSpec;
|
|
692
|
+
|
|
693
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
694
|
+
while (1) {
|
|
695
|
+
switch (_context6.prev = _context6.next) {
|
|
696
|
+
case 0:
|
|
697
|
+
policyId = _ref6.policyId, policyWriteToken = _ref6.policyWriteToken, itemId = _ref6.itemId, _ref6$profiles = _ref6.profiles, profiles = _ref6$profiles === void 0 ? {} : _ref6$profiles;
|
|
698
|
+
ValidatePresence("policyId", policyId);
|
|
699
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
700
|
+
ValidatePresence("itemId", itemId);
|
|
701
|
+
ValidatePresence("profiles", profiles);
|
|
702
|
+
_context6.t1 = this.client;
|
|
703
|
+
_context6.next = 8;
|
|
704
|
+
return this.client.ContentObjectLibraryId({
|
|
705
|
+
objectId: itemId
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
case 8:
|
|
709
|
+
_context6.t2 = _context6.sent;
|
|
710
|
+
_context6.t3 = itemId;
|
|
711
|
+
_context6.t4 = ["public/name", "public/asset_metadata/title", "public/asset_metadata/display_title"];
|
|
712
|
+
_context6.t5 = {
|
|
713
|
+
libraryId: _context6.t2,
|
|
714
|
+
objectId: _context6.t3,
|
|
715
|
+
select: _context6.t4
|
|
716
|
+
};
|
|
717
|
+
_context6.next = 14;
|
|
718
|
+
return _context6.t1.ContentObjectMetadata.call(_context6.t1, _context6.t5);
|
|
719
|
+
|
|
720
|
+
case 14:
|
|
721
|
+
_context6.t0 = _context6.sent;
|
|
722
|
+
|
|
723
|
+
if (_context6.t0) {
|
|
724
|
+
_context6.next = 17;
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
_context6.t0 = {};
|
|
729
|
+
|
|
730
|
+
case 17:
|
|
731
|
+
metadata = _context6.t0;
|
|
732
|
+
assetMetadata = (metadata["public"] || {}).asset_metadata || {};
|
|
733
|
+
displayTitle = assetMetadata.display_title || assetMetadata.title || (metadata["public"] || {}).name;
|
|
734
|
+
itemSpec = {
|
|
735
|
+
display_title: displayTitle,
|
|
736
|
+
permissions: [],
|
|
737
|
+
profiles: {}
|
|
738
|
+
};
|
|
739
|
+
Object.keys(profiles).forEach(function (profileName) {
|
|
740
|
+
itemSpec.profiles[profileName] = _this2.FormatProfile(profiles[profileName]);
|
|
741
|
+
});
|
|
742
|
+
_context6.t6 = this.client;
|
|
743
|
+
_context6.next = 25;
|
|
744
|
+
return this.client.ContentObjectLibraryId({
|
|
745
|
+
objectId: policyId
|
|
746
|
+
});
|
|
694
747
|
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
case 28:
|
|
717
|
-
_context6.t10 = _context6.sent;
|
|
718
|
-
_context6.t11 = policyId;
|
|
719
|
-
_context6.t12 = policyWriteToken;
|
|
720
|
-
_context6.t13 = UrlJoin("auth_policy_spec", itemId);
|
|
721
|
-
_context6.t14 = itemSpec;
|
|
722
|
-
_context6.t15 = {
|
|
723
|
-
libraryId: _context6.t10,
|
|
724
|
-
objectId: _context6.t11,
|
|
725
|
-
writeToken: _context6.t12,
|
|
726
|
-
metadataSubtree: _context6.t13,
|
|
727
|
-
metadata: _context6.t14
|
|
728
|
-
};
|
|
729
|
-
_context6.t16 = _context6.t9.ReplaceMetadata.call(_context6.t9, _context6.t15);
|
|
730
|
-
_context6.next = 37;
|
|
731
|
-
return _context6.t8.awrap.call(_context6.t8, _context6.t16);
|
|
732
|
-
|
|
733
|
-
case 37:
|
|
734
|
-
case "end":
|
|
735
|
-
return _context6.stop();
|
|
748
|
+
case 25:
|
|
749
|
+
_context6.t7 = _context6.sent;
|
|
750
|
+
_context6.t8 = policyId;
|
|
751
|
+
_context6.t9 = policyWriteToken;
|
|
752
|
+
_context6.t10 = UrlJoin("auth_policy_spec", itemId);
|
|
753
|
+
_context6.t11 = itemSpec;
|
|
754
|
+
_context6.t12 = {
|
|
755
|
+
libraryId: _context6.t7,
|
|
756
|
+
objectId: _context6.t8,
|
|
757
|
+
writeToken: _context6.t9,
|
|
758
|
+
metadataSubtree: _context6.t10,
|
|
759
|
+
metadata: _context6.t11
|
|
760
|
+
};
|
|
761
|
+
_context6.next = 33;
|
|
762
|
+
return _context6.t6.ReplaceMetadata.call(_context6.t6, _context6.t12);
|
|
763
|
+
|
|
764
|
+
case 33:
|
|
765
|
+
case "end":
|
|
766
|
+
return _context6.stop();
|
|
767
|
+
}
|
|
736
768
|
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
|
|
769
|
+
}, _callee6, this);
|
|
770
|
+
}));
|
|
771
|
+
|
|
772
|
+
function CreateItemPolicy(_x6) {
|
|
773
|
+
return _CreateItemPolicy.apply(this, arguments);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return CreateItemPolicy;
|
|
777
|
+
}()
|
|
740
778
|
/**
|
|
741
779
|
* Remove the specified item policy
|
|
742
780
|
*
|
|
@@ -749,45 +787,51 @@ function () {
|
|
|
749
787
|
|
|
750
788
|
}, {
|
|
751
789
|
key: "RemoveItemPolicy",
|
|
752
|
-
value: function
|
|
753
|
-
var
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
790
|
+
value: function () {
|
|
791
|
+
var _RemoveItemPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref7) {
|
|
792
|
+
var policyId, policyWriteToken, itemId;
|
|
793
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
794
|
+
while (1) {
|
|
795
|
+
switch (_context7.prev = _context7.next) {
|
|
796
|
+
case 0:
|
|
797
|
+
policyId = _ref7.policyId, policyWriteToken = _ref7.policyWriteToken, itemId = _ref7.itemId;
|
|
798
|
+
ValidatePresence("policyId", policyId);
|
|
799
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
800
|
+
ValidatePresence("itemId", itemId);
|
|
801
|
+
_context7.t0 = this.client;
|
|
802
|
+
_context7.next = 7;
|
|
803
|
+
return this.client.ContentObjectLibraryId({
|
|
804
|
+
objectId: policyId
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
case 7:
|
|
808
|
+
_context7.t1 = _context7.sent;
|
|
809
|
+
_context7.t2 = policyId;
|
|
810
|
+
_context7.t3 = policyWriteToken;
|
|
811
|
+
_context7.t4 = UrlJoin("auth_policy_spec", itemId);
|
|
812
|
+
_context7.t5 = {
|
|
813
|
+
libraryId: _context7.t1,
|
|
814
|
+
objectId: _context7.t2,
|
|
815
|
+
writeToken: _context7.t3,
|
|
816
|
+
metadataSubtree: _context7.t4
|
|
817
|
+
};
|
|
818
|
+
_context7.next = 14;
|
|
819
|
+
return _context7.t0.DeleteMetadata.call(_context7.t0, _context7.t5);
|
|
820
|
+
|
|
821
|
+
case 14:
|
|
822
|
+
case "end":
|
|
823
|
+
return _context7.stop();
|
|
824
|
+
}
|
|
787
825
|
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
|
|
826
|
+
}, _callee7, this);
|
|
827
|
+
}));
|
|
828
|
+
|
|
829
|
+
function RemoveItemPolicy(_x7) {
|
|
830
|
+
return _RemoveItemPolicy.apply(this, arguments);
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
return RemoveItemPolicy;
|
|
834
|
+
}()
|
|
791
835
|
/* Get / set / remove profile permissions */
|
|
792
836
|
|
|
793
837
|
/**
|
|
@@ -803,45 +847,51 @@ function () {
|
|
|
803
847
|
|
|
804
848
|
}, {
|
|
805
849
|
key: "ItemProfiles",
|
|
806
|
-
value: function
|
|
807
|
-
var
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
850
|
+
value: function () {
|
|
851
|
+
var _ItemProfiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref8) {
|
|
852
|
+
var policyId, policyWriteToken, itemId, profileName;
|
|
853
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
854
|
+
while (1) {
|
|
855
|
+
switch (_context8.prev = _context8.next) {
|
|
856
|
+
case 0:
|
|
857
|
+
policyId = _ref8.policyId, policyWriteToken = _ref8.policyWriteToken, itemId = _ref8.itemId, profileName = _ref8.profileName;
|
|
858
|
+
_context8.t0 = this.client;
|
|
859
|
+
_context8.next = 4;
|
|
860
|
+
return this.client.ContentObjectLibraryId({
|
|
861
|
+
objectId: policyId
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
case 4:
|
|
865
|
+
_context8.t1 = _context8.sent;
|
|
866
|
+
_context8.t2 = policyId;
|
|
867
|
+
_context8.t3 = policyWriteToken;
|
|
868
|
+
_context8.t4 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName || "");
|
|
869
|
+
_context8.t5 = {
|
|
870
|
+
libraryId: _context8.t1,
|
|
871
|
+
objectId: _context8.t2,
|
|
872
|
+
writeToken: _context8.t3,
|
|
873
|
+
metadataSubtree: _context8.t4
|
|
874
|
+
};
|
|
875
|
+
_context8.next = 11;
|
|
876
|
+
return _context8.t0.ContentObjectMetadata.call(_context8.t0, _context8.t5);
|
|
877
|
+
|
|
878
|
+
case 11:
|
|
879
|
+
return _context8.abrupt("return", _context8.sent);
|
|
880
|
+
|
|
881
|
+
case 12:
|
|
882
|
+
case "end":
|
|
883
|
+
return _context8.stop();
|
|
884
|
+
}
|
|
841
885
|
}
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
|
|
886
|
+
}, _callee8, this);
|
|
887
|
+
}));
|
|
888
|
+
|
|
889
|
+
function ItemProfiles(_x8) {
|
|
890
|
+
return _ItemProfiles.apply(this, arguments);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
return ItemProfiles;
|
|
894
|
+
}()
|
|
845
895
|
/**
|
|
846
896
|
* Create or modify a profile for the specified item policy
|
|
847
897
|
*
|
|
@@ -857,49 +907,55 @@ function () {
|
|
|
857
907
|
|
|
858
908
|
}, {
|
|
859
909
|
key: "SetProfile",
|
|
860
|
-
value: function
|
|
861
|
-
var
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
910
|
+
value: function () {
|
|
911
|
+
var _SetProfile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref9) {
|
|
912
|
+
var policyId, policyWriteToken, itemId, profileName, profileSpec;
|
|
913
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
914
|
+
while (1) {
|
|
915
|
+
switch (_context9.prev = _context9.next) {
|
|
916
|
+
case 0:
|
|
917
|
+
policyId = _ref9.policyId, policyWriteToken = _ref9.policyWriteToken, itemId = _ref9.itemId, profileName = _ref9.profileName, profileSpec = _ref9.profileSpec;
|
|
918
|
+
ValidatePresence("policyId", policyId);
|
|
919
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
920
|
+
ValidatePresence("itemId", itemId);
|
|
921
|
+
ValidatePresence("profileName", profileName);
|
|
922
|
+
ValidatePresence("profileSpec", profileSpec);
|
|
923
|
+
_context9.t0 = this.client;
|
|
924
|
+
_context9.next = 9;
|
|
925
|
+
return this.client.ContentObjectLibraryId({
|
|
926
|
+
objectId: policyId
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
case 9:
|
|
930
|
+
_context9.t1 = _context9.sent;
|
|
931
|
+
_context9.t2 = policyId;
|
|
932
|
+
_context9.t3 = policyWriteToken;
|
|
933
|
+
_context9.t4 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName);
|
|
934
|
+
_context9.t5 = this.FormatProfile(profileSpec);
|
|
935
|
+
_context9.t6 = {
|
|
936
|
+
libraryId: _context9.t1,
|
|
937
|
+
objectId: _context9.t2,
|
|
938
|
+
writeToken: _context9.t3,
|
|
939
|
+
metadataSubtree: _context9.t4,
|
|
940
|
+
metadata: _context9.t5
|
|
941
|
+
};
|
|
942
|
+
_context9.next = 17;
|
|
943
|
+
return _context9.t0.ReplaceMetadata.call(_context9.t0, _context9.t6);
|
|
944
|
+
|
|
945
|
+
case 17:
|
|
946
|
+
case "end":
|
|
947
|
+
return _context9.stop();
|
|
948
|
+
}
|
|
899
949
|
}
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
|
|
950
|
+
}, _callee9, this);
|
|
951
|
+
}));
|
|
952
|
+
|
|
953
|
+
function SetProfile(_x9) {
|
|
954
|
+
return _SetProfile.apply(this, arguments);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
return SetProfile;
|
|
958
|
+
}()
|
|
903
959
|
/**
|
|
904
960
|
* Remove a profile from the specified item policy
|
|
905
961
|
*
|
|
@@ -915,46 +971,52 @@ function () {
|
|
|
915
971
|
|
|
916
972
|
}, {
|
|
917
973
|
key: "RemoveProfile",
|
|
918
|
-
value: function
|
|
919
|
-
var
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
974
|
+
value: function () {
|
|
975
|
+
var _RemoveProfile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref10) {
|
|
976
|
+
var policyId, policyWriteToken, itemId, profileName;
|
|
977
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
978
|
+
while (1) {
|
|
979
|
+
switch (_context10.prev = _context10.next) {
|
|
980
|
+
case 0:
|
|
981
|
+
policyId = _ref10.policyId, policyWriteToken = _ref10.policyWriteToken, itemId = _ref10.itemId, profileName = _ref10.profileName;
|
|
982
|
+
ValidatePresence("policyId", policyId);
|
|
983
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
984
|
+
ValidatePresence("itemId", itemId);
|
|
985
|
+
ValidatePresence("profileName", profileName);
|
|
986
|
+
_context10.t0 = this.client;
|
|
987
|
+
_context10.next = 8;
|
|
988
|
+
return this.client.ContentObjectLibraryId({
|
|
989
|
+
objectId: policyId
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
case 8:
|
|
993
|
+
_context10.t1 = _context10.sent;
|
|
994
|
+
_context10.t2 = policyId;
|
|
995
|
+
_context10.t3 = policyWriteToken;
|
|
996
|
+
_context10.t4 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName);
|
|
997
|
+
_context10.t5 = {
|
|
998
|
+
libraryId: _context10.t1,
|
|
999
|
+
objectId: _context10.t2,
|
|
1000
|
+
writeToken: _context10.t3,
|
|
1001
|
+
metadataSubtree: _context10.t4
|
|
1002
|
+
};
|
|
1003
|
+
_context10.next = 15;
|
|
1004
|
+
return _context10.t0.DeleteMetadata.call(_context10.t0, _context10.t5);
|
|
1005
|
+
|
|
1006
|
+
case 15:
|
|
1007
|
+
case "end":
|
|
1008
|
+
return _context10.stop();
|
|
1009
|
+
}
|
|
954
1010
|
}
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
|
|
1011
|
+
}, _callee10, this);
|
|
1012
|
+
}));
|
|
1013
|
+
|
|
1014
|
+
function RemoveProfile(_x10) {
|
|
1015
|
+
return _RemoveProfile.apply(this, arguments);
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
return RemoveProfile;
|
|
1019
|
+
}()
|
|
958
1020
|
/* Get / set / remove subject permissions */
|
|
959
1021
|
|
|
960
1022
|
/**
|
|
@@ -971,76 +1033,90 @@ function () {
|
|
|
971
1033
|
|
|
972
1034
|
}, {
|
|
973
1035
|
key: "ItemPermissions",
|
|
974
|
-
value: function
|
|
975
|
-
var
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
case 3:
|
|
989
|
-
libraryId = _context12.sent;
|
|
990
|
-
_context12.next = 6;
|
|
991
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
992
|
-
libraryId: libraryId,
|
|
993
|
-
objectId: policyId,
|
|
994
|
-
writeToken: policyWriteToken,
|
|
995
|
-
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions")
|
|
996
|
-
}));
|
|
997
|
-
|
|
998
|
-
case 6:
|
|
999
|
-
_context12.t0 = _context12.sent;
|
|
1000
|
-
|
|
1001
|
-
if (_context12.t0) {
|
|
1002
|
-
_context12.next = 9;
|
|
1003
|
-
break;
|
|
1004
|
-
}
|
|
1036
|
+
value: function () {
|
|
1037
|
+
var _ItemPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref11) {
|
|
1038
|
+
var _this3 = this;
|
|
1039
|
+
|
|
1040
|
+
var policyId, policyWriteToken, itemId, libraryId, permissions;
|
|
1041
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
1042
|
+
while (1) {
|
|
1043
|
+
switch (_context12.prev = _context12.next) {
|
|
1044
|
+
case 0:
|
|
1045
|
+
policyId = _ref11.policyId, policyWriteToken = _ref11.policyWriteToken, itemId = _ref11.itemId;
|
|
1046
|
+
_context12.next = 3;
|
|
1047
|
+
return this.client.ContentObjectLibraryId({
|
|
1048
|
+
objectId: policyId
|
|
1049
|
+
});
|
|
1005
1050
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
switch (_context11.prev = _context11.next) {
|
|
1015
|
-
case 0:
|
|
1016
|
-
_context11.next = 2;
|
|
1017
|
-
return _regeneratorRuntime.awrap(_this3.FormatPermission({
|
|
1018
|
-
policyId: policyId,
|
|
1019
|
-
policyWriteToken: policyWriteToken,
|
|
1020
|
-
permission: permission
|
|
1021
|
-
}));
|
|
1022
|
-
|
|
1023
|
-
case 2:
|
|
1024
|
-
return _context11.abrupt("return", _context11.sent);
|
|
1025
|
-
|
|
1026
|
-
case 3:
|
|
1027
|
-
case "end":
|
|
1028
|
-
return _context11.stop();
|
|
1029
|
-
}
|
|
1030
|
-
}
|
|
1051
|
+
case 3:
|
|
1052
|
+
libraryId = _context12.sent;
|
|
1053
|
+
_context12.next = 6;
|
|
1054
|
+
return this.client.ContentObjectMetadata({
|
|
1055
|
+
libraryId: libraryId,
|
|
1056
|
+
objectId: policyId,
|
|
1057
|
+
writeToken: policyWriteToken,
|
|
1058
|
+
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions")
|
|
1031
1059
|
});
|
|
1032
|
-
})));
|
|
1033
1060
|
|
|
1034
|
-
|
|
1035
|
-
|
|
1061
|
+
case 6:
|
|
1062
|
+
_context12.t0 = _context12.sent;
|
|
1036
1063
|
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1064
|
+
if (_context12.t0) {
|
|
1065
|
+
_context12.next = 9;
|
|
1066
|
+
break;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
_context12.t0 = [];
|
|
1070
|
+
|
|
1071
|
+
case 9:
|
|
1072
|
+
permissions = _context12.t0;
|
|
1073
|
+
_context12.next = 12;
|
|
1074
|
+
return Promise.all(permissions.map( /*#__PURE__*/function () {
|
|
1075
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(permission) {
|
|
1076
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
1077
|
+
while (1) {
|
|
1078
|
+
switch (_context11.prev = _context11.next) {
|
|
1079
|
+
case 0:
|
|
1080
|
+
_context11.next = 2;
|
|
1081
|
+
return _this3.FormatPermission({
|
|
1082
|
+
policyId: policyId,
|
|
1083
|
+
policyWriteToken: policyWriteToken,
|
|
1084
|
+
permission: permission
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
case 2:
|
|
1088
|
+
return _context11.abrupt("return", _context11.sent);
|
|
1089
|
+
|
|
1090
|
+
case 3:
|
|
1091
|
+
case "end":
|
|
1092
|
+
return _context11.stop();
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
}, _callee11);
|
|
1096
|
+
}));
|
|
1097
|
+
|
|
1098
|
+
return function (_x12) {
|
|
1099
|
+
return _ref12.apply(this, arguments);
|
|
1100
|
+
};
|
|
1101
|
+
}()));
|
|
1102
|
+
|
|
1103
|
+
case 12:
|
|
1104
|
+
return _context12.abrupt("return", _context12.sent);
|
|
1105
|
+
|
|
1106
|
+
case 13:
|
|
1107
|
+
case "end":
|
|
1108
|
+
return _context12.stop();
|
|
1109
|
+
}
|
|
1040
1110
|
}
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1111
|
+
}, _callee12, this);
|
|
1112
|
+
}));
|
|
1113
|
+
|
|
1114
|
+
function ItemPermissions(_x11) {
|
|
1115
|
+
return _ItemPermissions.apply(this, arguments);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
return ItemPermissions;
|
|
1119
|
+
}()
|
|
1044
1120
|
/**
|
|
1045
1121
|
* Add or modify permission for the specified subject to the specified item policy
|
|
1046
1122
|
*
|
|
@@ -1061,346 +1137,354 @@ function () {
|
|
|
1061
1137
|
|
|
1062
1138
|
}, {
|
|
1063
1139
|
key: "SetPermission",
|
|
1064
|
-
value: function
|
|
1065
|
-
var
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1140
|
+
value: function () {
|
|
1141
|
+
var _SetPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref13) {
|
|
1142
|
+
var policyId, policyWriteToken, itemId, _ref13$subjectSource, subjectSource, _ref13$subjectType, subjectType, subjectName, subjectId, subjectNTPId, profileName, start, end, offlineDraft, policyLibraryId, existingPermissions, index, permissionSpec, subjectInfo, newMeta, userInfo, _newMeta, _userInfo;
|
|
1143
|
+
|
|
1144
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
1145
|
+
while (1) {
|
|
1146
|
+
switch (_context13.prev = _context13.next) {
|
|
1147
|
+
case 0:
|
|
1148
|
+
policyId = _ref13.policyId, policyWriteToken = _ref13.policyWriteToken, itemId = _ref13.itemId, _ref13$subjectSource = _ref13.subjectSource, subjectSource = _ref13$subjectSource === void 0 ? "fabric" : _ref13$subjectSource, _ref13$subjectType = _ref13.subjectType, subjectType = _ref13$subjectType === void 0 ? "group" : _ref13$subjectType, subjectName = _ref13.subjectName, subjectId = _ref13.subjectId, subjectNTPId = _ref13.subjectNTPId, profileName = _ref13.profileName, start = _ref13.start, end = _ref13.end;
|
|
1149
|
+
ValidatePresence("policyId", policyId);
|
|
1150
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
1151
|
+
ValidatePresence("itemId", itemId);
|
|
1152
|
+
ValidatePresence("subjectType", subjectType);
|
|
1153
|
+
ValidatePresence("subjectSource", subjectSource);
|
|
1154
|
+
ValidatePresence("subjectId", subjectId);
|
|
1155
|
+
ValidatePresence("profileName", profileName);
|
|
1156
|
+
start = this.FormatDate(start);
|
|
1157
|
+
end = this.FormatDate(end); // Check if we have an open offline draft for this policy
|
|
1158
|
+
|
|
1159
|
+
offlineDraft = this.offline && this.drafts[policyId] != null;
|
|
1160
|
+
policyLibraryId = null;
|
|
1161
|
+
|
|
1162
|
+
if (offlineDraft) {
|
|
1163
|
+
_context13.next = 16;
|
|
1164
|
+
break;
|
|
1165
|
+
}
|
|
1089
1166
|
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1167
|
+
_context13.next = 15;
|
|
1168
|
+
return this.client.ContentObjectLibraryId({
|
|
1169
|
+
objectId: policyId
|
|
1170
|
+
});
|
|
1094
1171
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1172
|
+
case 15:
|
|
1173
|
+
policyLibraryId = _context13.sent;
|
|
1097
1174
|
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1175
|
+
case 16:
|
|
1176
|
+
// Allow address to be passed in for fabric subjects, though spec requires iusr/igrp hash
|
|
1177
|
+
if (subjectSource === "fabric") {
|
|
1178
|
+
if (subjectType === "group") {
|
|
1179
|
+
if (!subjectId.startsWith("igrp")) {
|
|
1180
|
+
subjectId = "igrp".concat(this.client.utils.AddressToHash(subjectId));
|
|
1181
|
+
}
|
|
1182
|
+
} else if (subjectType === "user") {
|
|
1183
|
+
if (!subjectId.startsWith("iusr")) {
|
|
1184
|
+
subjectId = "iusr".concat(this.client.utils.AddressToHash(subjectId));
|
|
1185
|
+
}
|
|
1108
1186
|
}
|
|
1109
1187
|
}
|
|
1110
|
-
}
|
|
1111
1188
|
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1189
|
+
if (!offlineDraft) {
|
|
1190
|
+
_context13.next = 21;
|
|
1191
|
+
break;
|
|
1192
|
+
}
|
|
1116
1193
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
break;
|
|
1120
|
-
|
|
1121
|
-
case 21:
|
|
1122
|
-
_context13.next = 23;
|
|
1123
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
1124
|
-
libraryId: policyLibraryId,
|
|
1125
|
-
objectId: policyId,
|
|
1126
|
-
writeToken: policyWriteToken,
|
|
1127
|
-
metadataSubtree: UrlJoin("auth_policy_spec", itemId)
|
|
1128
|
-
}));
|
|
1129
|
-
|
|
1130
|
-
case 23:
|
|
1131
|
-
existingPermissions = _context13.sent;
|
|
1132
|
-
|
|
1133
|
-
case 24:
|
|
1134
|
-
if (existingPermissions) {
|
|
1135
|
-
_context13.next = 26;
|
|
1194
|
+
existingPermissions = this.drafts[policyId].meta["auth_policy_spec"][itemId];
|
|
1195
|
+
_context13.next = 24;
|
|
1136
1196
|
break;
|
|
1137
|
-
}
|
|
1138
1197
|
|
|
1139
|
-
|
|
1198
|
+
case 21:
|
|
1199
|
+
_context13.next = 23;
|
|
1200
|
+
return this.client.ContentObjectMetadata({
|
|
1201
|
+
libraryId: policyLibraryId,
|
|
1202
|
+
objectId: policyId,
|
|
1203
|
+
writeToken: policyWriteToken,
|
|
1204
|
+
metadataSubtree: UrlJoin("auth_policy_spec", itemId)
|
|
1205
|
+
});
|
|
1206
|
+
|
|
1207
|
+
case 23:
|
|
1208
|
+
existingPermissions = _context13.sent;
|
|
1140
1209
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1210
|
+
case 24:
|
|
1211
|
+
if (existingPermissions) {
|
|
1212
|
+
_context13.next = 26;
|
|
1213
|
+
break;
|
|
1214
|
+
}
|
|
1146
1215
|
|
|
1147
|
-
|
|
1216
|
+
throw Error("Unable to add permissions to uninitialized item");
|
|
1148
1217
|
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
} else {
|
|
1154
|
-
return permission.subject.oauth_id === subjectId;
|
|
1218
|
+
case 26:
|
|
1219
|
+
if (existingPermissions.profiles[profileName]) {
|
|
1220
|
+
_context13.next = 28;
|
|
1221
|
+
break;
|
|
1155
1222
|
}
|
|
1156
|
-
});
|
|
1157
1223
|
|
|
1158
|
-
|
|
1159
|
-
index = existingPermissions.permissions.length;
|
|
1160
|
-
}
|
|
1224
|
+
throw Error("Profile '".concat(profileName, "' does not exist"));
|
|
1161
1225
|
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1226
|
+
case 28:
|
|
1227
|
+
index = existingPermissions.permissions.findIndex(function (permission) {
|
|
1228
|
+
if (subjectSource === "fabric") {
|
|
1229
|
+
return permission.subject.id === subjectId;
|
|
1230
|
+
} else {
|
|
1231
|
+
return permission.subject.oauth_id === subjectId;
|
|
1232
|
+
}
|
|
1233
|
+
});
|
|
1165
1234
|
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1235
|
+
if (index < 0) {
|
|
1236
|
+
index = existingPermissions.permissions.length;
|
|
1237
|
+
}
|
|
1169
1238
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1239
|
+
permissionSpec = {
|
|
1240
|
+
profile: profileName
|
|
1241
|
+
};
|
|
1173
1242
|
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
}
|
|
1243
|
+
if (start) {
|
|
1244
|
+
permissionSpec.start = start;
|
|
1245
|
+
}
|
|
1178
1246
|
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1247
|
+
if (end) {
|
|
1248
|
+
permissionSpec.end = end;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
if (!(subjectSource === "fabric")) {
|
|
1252
|
+
_context13.next = 53;
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1183
1255
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
_context13.next = 51;
|
|
1189
|
-
break;
|
|
1256
|
+
if (!(subjectType === "group")) {
|
|
1257
|
+
_context13.next = 38;
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1190
1260
|
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1261
|
+
subjectInfo = {
|
|
1262
|
+
id: subjectId,
|
|
1263
|
+
type: "group"
|
|
1264
|
+
};
|
|
1265
|
+
_context13.next = 51;
|
|
1194
1266
|
break;
|
|
1195
|
-
}
|
|
1196
1267
|
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
break;
|
|
1268
|
+
case 38:
|
|
1269
|
+
if (!(subjectType === "user")) {
|
|
1270
|
+
_context13.next = 42;
|
|
1271
|
+
break;
|
|
1272
|
+
}
|
|
1203
1273
|
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1274
|
+
subjectInfo = {
|
|
1275
|
+
id: subjectId,
|
|
1276
|
+
type: "user"
|
|
1277
|
+
};
|
|
1278
|
+
_context13.next = 51;
|
|
1207
1279
|
break;
|
|
1208
|
-
}
|
|
1209
1280
|
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
break;
|
|
1281
|
+
case 42:
|
|
1282
|
+
if (!(subjectType === "ntp")) {
|
|
1283
|
+
_context13.next = 46;
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1216
1286
|
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1287
|
+
subjectInfo = {
|
|
1288
|
+
id: subjectId,
|
|
1289
|
+
type: "otp"
|
|
1290
|
+
};
|
|
1291
|
+
_context13.next = 51;
|
|
1220
1292
|
break;
|
|
1221
|
-
}
|
|
1222
1293
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
_context13.next = 51;
|
|
1229
|
-
break;
|
|
1294
|
+
case 46:
|
|
1295
|
+
if (!(subjectType === "ntp_subject")) {
|
|
1296
|
+
_context13.next = 50;
|
|
1297
|
+
break;
|
|
1298
|
+
}
|
|
1230
1299
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1300
|
+
subjectInfo = {
|
|
1301
|
+
id: subjectId,
|
|
1302
|
+
otp_id: subjectNTPId,
|
|
1303
|
+
type: "otp_subject"
|
|
1304
|
+
};
|
|
1305
|
+
_context13.next = 51;
|
|
1306
|
+
break;
|
|
1233
1307
|
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
break;
|
|
1308
|
+
case 50:
|
|
1309
|
+
throw Error("Invalid subject type: ".concat(subjectType));
|
|
1237
1310
|
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
_context13.next = 65;
|
|
1311
|
+
case 51:
|
|
1312
|
+
_context13.next = 66;
|
|
1241
1313
|
break;
|
|
1242
|
-
}
|
|
1243
1314
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1315
|
+
case 53:
|
|
1316
|
+
if (!(subjectSource === "oauth")) {
|
|
1317
|
+
_context13.next = 65;
|
|
1318
|
+
break;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
if (!(subjectType === "group")) {
|
|
1322
|
+
_context13.next = 58;
|
|
1323
|
+
break;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
subjectInfo = {
|
|
1327
|
+
id: subjectName,
|
|
1328
|
+
oauth_id: subjectId,
|
|
1329
|
+
type: "oauth_group"
|
|
1330
|
+
};
|
|
1331
|
+
_context13.next = 63;
|
|
1246
1332
|
break;
|
|
1247
|
-
}
|
|
1248
1333
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1334
|
+
case 58:
|
|
1335
|
+
if (!(subjectType === "user")) {
|
|
1336
|
+
_context13.next = 62;
|
|
1337
|
+
break;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
subjectInfo = {
|
|
1341
|
+
id: subjectName,
|
|
1342
|
+
oauth_id: subjectId,
|
|
1343
|
+
type: "oauth_user"
|
|
1344
|
+
};
|
|
1345
|
+
_context13.next = 63;
|
|
1260
1346
|
break;
|
|
1261
|
-
}
|
|
1262
1347
|
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
oauth_id: subjectId,
|
|
1266
|
-
type: "oauth_user"
|
|
1267
|
-
};
|
|
1268
|
-
_context13.next = 63;
|
|
1269
|
-
break;
|
|
1348
|
+
case 62:
|
|
1349
|
+
throw Error("Invalid subject type: ".concat(subjectType));
|
|
1270
1350
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1351
|
+
case 63:
|
|
1352
|
+
_context13.next = 66;
|
|
1353
|
+
break;
|
|
1273
1354
|
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
break;
|
|
1355
|
+
case 65:
|
|
1356
|
+
throw Error("Invalid subject source: ".concat(subjectSource));
|
|
1277
1357
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1358
|
+
case 66:
|
|
1359
|
+
permissionSpec.subject = subjectInfo;
|
|
1360
|
+
existingPermissions.permissions[index] = permissionSpec;
|
|
1280
1361
|
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1362
|
+
if (offlineDraft) {
|
|
1363
|
+
_context13.next = 71;
|
|
1364
|
+
break;
|
|
1365
|
+
}
|
|
1284
1366
|
|
|
1285
|
-
if (offlineDraft) {
|
|
1286
1367
|
_context13.next = 71;
|
|
1287
|
-
|
|
1288
|
-
|
|
1368
|
+
return this.client.ReplaceMetadata({
|
|
1369
|
+
libraryId: policyLibraryId,
|
|
1370
|
+
objectId: policyId,
|
|
1371
|
+
writeToken: policyWriteToken,
|
|
1372
|
+
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions"),
|
|
1373
|
+
metadata: existingPermissions.permissions
|
|
1374
|
+
});
|
|
1289
1375
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
if (!(subjectSource === "fabric" && subjectType === "user")) {
|
|
1301
|
-
_context13.next = 85;
|
|
1302
|
-
break;
|
|
1303
|
-
}
|
|
1376
|
+
case 71:
|
|
1377
|
+
if (!(subjectSource === "fabric" && subjectType === "user")) {
|
|
1378
|
+
_context13.next = 85;
|
|
1379
|
+
break;
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
newMeta = {
|
|
1383
|
+
address: this.client.utils.HashToAddress(subjectId),
|
|
1384
|
+
name: subjectName
|
|
1385
|
+
};
|
|
1304
1386
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1387
|
+
if (!offlineDraft) {
|
|
1388
|
+
_context13.next = 77;
|
|
1389
|
+
break;
|
|
1390
|
+
}
|
|
1309
1391
|
|
|
1310
|
-
|
|
1311
|
-
_context13.next =
|
|
1392
|
+
this.drafts[policyId].meta["auth_policy_settings"]["fabric_users"][this.client.utils.HashToAddress(subjectId)] = newMeta;
|
|
1393
|
+
_context13.next = 83;
|
|
1312
1394
|
break;
|
|
1313
|
-
}
|
|
1314
1395
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1396
|
+
case 77:
|
|
1397
|
+
_context13.next = 79;
|
|
1398
|
+
return this.client.ContentObjectMetadata({
|
|
1399
|
+
libraryId: policyLibraryId,
|
|
1400
|
+
objectId: policyId,
|
|
1401
|
+
writeToken: policyWriteToken,
|
|
1402
|
+
metadataSubtree: UrlJoin("auth_policy_settings", "fabric_users", this.client.utils.HashToAddress(subjectId))
|
|
1403
|
+
});
|
|
1318
1404
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
1322
|
-
libraryId: policyLibraryId,
|
|
1323
|
-
objectId: policyId,
|
|
1324
|
-
writeToken: policyWriteToken,
|
|
1325
|
-
metadataSubtree: UrlJoin("auth_policy_settings", "fabric_users", this.client.utils.HashToAddress(subjectId))
|
|
1326
|
-
}));
|
|
1405
|
+
case 79:
|
|
1406
|
+
userInfo = _context13.sent;
|
|
1327
1407
|
|
|
1328
|
-
|
|
1329
|
-
|
|
1408
|
+
if (userInfo) {
|
|
1409
|
+
_context13.next = 83;
|
|
1410
|
+
break;
|
|
1411
|
+
}
|
|
1330
1412
|
|
|
1331
|
-
if (userInfo) {
|
|
1332
1413
|
_context13.next = 83;
|
|
1333
|
-
|
|
1334
|
-
|
|
1414
|
+
return this.client.ReplaceMetadata({
|
|
1415
|
+
libraryId: policyLibraryId,
|
|
1416
|
+
objectId: policyId,
|
|
1417
|
+
writeToken: policyWriteToken,
|
|
1418
|
+
metadataSubtree: UrlJoin("auth_policy_settings", "fabric_users", this.client.utils.HashToAddress(subjectId)),
|
|
1419
|
+
metadata: newMeta
|
|
1420
|
+
});
|
|
1335
1421
|
|
|
1336
|
-
|
|
1337
|
-
return _regeneratorRuntime.awrap(this.client.ReplaceMetadata({
|
|
1338
|
-
libraryId: policyLibraryId,
|
|
1339
|
-
objectId: policyId,
|
|
1340
|
-
writeToken: policyWriteToken,
|
|
1341
|
-
metadataSubtree: UrlJoin("auth_policy_settings", "fabric_users", this.client.utils.HashToAddress(subjectId)),
|
|
1342
|
-
metadata: newMeta
|
|
1343
|
-
}));
|
|
1344
|
-
|
|
1345
|
-
case 83:
|
|
1346
|
-
_context13.next = 97;
|
|
1347
|
-
break;
|
|
1348
|
-
|
|
1349
|
-
case 85:
|
|
1350
|
-
if (!(subjectSource === "fabric" && subjectType === "ntp")) {
|
|
1422
|
+
case 83:
|
|
1351
1423
|
_context13.next = 97;
|
|
1352
1424
|
break;
|
|
1353
|
-
}
|
|
1354
1425
|
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1426
|
+
case 85:
|
|
1427
|
+
if (!(subjectSource === "fabric" && subjectType === "ntp")) {
|
|
1428
|
+
_context13.next = 97;
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
_newMeta = {
|
|
1433
|
+
address: subjectId,
|
|
1434
|
+
ntpId: subjectId,
|
|
1435
|
+
name: subjectName,
|
|
1436
|
+
type: "ntpInstance"
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
if (!offlineDraft) {
|
|
1440
|
+
_context13.next = 91;
|
|
1441
|
+
break;
|
|
1442
|
+
}
|
|
1361
1443
|
|
|
1362
|
-
|
|
1363
|
-
_context13.next =
|
|
1444
|
+
this.drafts[policyId].meta["auth_policy_settings"]["ntp_instances"][subjectId] = _newMeta;
|
|
1445
|
+
_context13.next = 97;
|
|
1364
1446
|
break;
|
|
1365
|
-
}
|
|
1366
1447
|
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1448
|
+
case 91:
|
|
1449
|
+
_context13.next = 93;
|
|
1450
|
+
return this.client.ContentObjectMetadata({
|
|
1451
|
+
libraryId: policyLibraryId,
|
|
1452
|
+
objectId: policyId,
|
|
1453
|
+
writeToken: policyWriteToken,
|
|
1454
|
+
metadataSubtree: UrlJoin("auth_policy_settings", "ntp_instances", subjectId)
|
|
1455
|
+
});
|
|
1370
1456
|
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
1374
|
-
libraryId: policyLibraryId,
|
|
1375
|
-
objectId: policyId,
|
|
1376
|
-
writeToken: policyWriteToken,
|
|
1377
|
-
metadataSubtree: UrlJoin("auth_policy_settings", "ntp_instances", subjectId)
|
|
1378
|
-
}));
|
|
1457
|
+
case 93:
|
|
1458
|
+
_userInfo = _context13.sent;
|
|
1379
1459
|
|
|
1380
|
-
|
|
1381
|
-
|
|
1460
|
+
if (_userInfo) {
|
|
1461
|
+
_context13.next = 97;
|
|
1462
|
+
break;
|
|
1463
|
+
}
|
|
1382
1464
|
|
|
1383
|
-
if (_userInfo) {
|
|
1384
1465
|
_context13.next = 97;
|
|
1385
|
-
|
|
1386
|
-
|
|
1466
|
+
return this.client.ReplaceMetadata({
|
|
1467
|
+
libraryId: policyLibraryId,
|
|
1468
|
+
objectId: policyId,
|
|
1469
|
+
writeToken: policyWriteToken,
|
|
1470
|
+
metadataSubtree: UrlJoin("auth_policy_settings", "ntp_instances", subjectId),
|
|
1471
|
+
metadata: _newMeta
|
|
1472
|
+
});
|
|
1387
1473
|
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
writeToken: policyWriteToken,
|
|
1393
|
-
metadataSubtree: UrlJoin("auth_policy_settings", "ntp_instances", subjectId),
|
|
1394
|
-
metadata: _newMeta
|
|
1395
|
-
}));
|
|
1396
|
-
|
|
1397
|
-
case 97:
|
|
1398
|
-
case "end":
|
|
1399
|
-
return _context13.stop();
|
|
1474
|
+
case 97:
|
|
1475
|
+
case "end":
|
|
1476
|
+
return _context13.stop();
|
|
1477
|
+
}
|
|
1400
1478
|
}
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1479
|
+
}, _callee13, this);
|
|
1480
|
+
}));
|
|
1481
|
+
|
|
1482
|
+
function SetPermission(_x13) {
|
|
1483
|
+
return _SetPermission.apply(this, arguments);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
return SetPermission;
|
|
1487
|
+
}()
|
|
1404
1488
|
/**
|
|
1405
1489
|
* Remove permission for the specified subject from the specified item policy
|
|
1406
1490
|
*
|
|
@@ -1414,106 +1498,120 @@ function () {
|
|
|
1414
1498
|
|
|
1415
1499
|
}, {
|
|
1416
1500
|
key: "RemovePermission",
|
|
1417
|
-
value: function
|
|
1418
|
-
var
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
case 7:
|
|
1436
|
-
policyLibraryId = _context15.sent;
|
|
1437
|
-
_context15.next = 10;
|
|
1438
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
1439
|
-
libraryId: policyLibraryId,
|
|
1440
|
-
objectId: policyId,
|
|
1441
|
-
writeToken: policyWriteToken,
|
|
1442
|
-
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions")
|
|
1443
|
-
}));
|
|
1444
|
-
|
|
1445
|
-
case 10:
|
|
1446
|
-
permissions = _context15.sent;
|
|
1447
|
-
|
|
1448
|
-
if (permissions) {
|
|
1449
|
-
_context15.next = 13;
|
|
1450
|
-
break;
|
|
1451
|
-
}
|
|
1501
|
+
value: function () {
|
|
1502
|
+
var _RemovePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref14) {
|
|
1503
|
+
var _this4 = this;
|
|
1504
|
+
|
|
1505
|
+
var policyId, policyWriteToken, itemId, subjectId, policyLibraryId, permissions, id;
|
|
1506
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
1507
|
+
while (1) {
|
|
1508
|
+
switch (_context15.prev = _context15.next) {
|
|
1509
|
+
case 0:
|
|
1510
|
+
policyId = _ref14.policyId, policyWriteToken = _ref14.policyWriteToken, itemId = _ref14.itemId, subjectId = _ref14.subjectId;
|
|
1511
|
+
ValidatePresence("policyId", policyId);
|
|
1512
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
1513
|
+
ValidatePresence("itemId", itemId);
|
|
1514
|
+
ValidatePresence("subjectId", subjectId);
|
|
1515
|
+
_context15.next = 7;
|
|
1516
|
+
return this.client.ContentObjectLibraryId({
|
|
1517
|
+
objectId: policyId
|
|
1518
|
+
});
|
|
1452
1519
|
|
|
1453
|
-
|
|
1520
|
+
case 7:
|
|
1521
|
+
policyLibraryId = _context15.sent;
|
|
1522
|
+
_context15.next = 10;
|
|
1523
|
+
return this.client.ContentObjectMetadata({
|
|
1524
|
+
libraryId: policyLibraryId,
|
|
1525
|
+
objectId: policyId,
|
|
1526
|
+
writeToken: policyWriteToken,
|
|
1527
|
+
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions")
|
|
1528
|
+
});
|
|
1454
1529
|
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1530
|
+
case 10:
|
|
1531
|
+
permissions = _context15.sent;
|
|
1532
|
+
|
|
1533
|
+
if (permissions) {
|
|
1534
|
+
_context15.next = 13;
|
|
1535
|
+
break;
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
return _context15.abrupt("return");
|
|
1460
1539
|
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1540
|
+
case 13:
|
|
1541
|
+
if (!subjectId.startsWith("0x")) {
|
|
1542
|
+
_context15.next = 23;
|
|
1543
|
+
break;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
id = this.client.utils.AddressToObjectId(subjectId);
|
|
1547
|
+
_context15.next = 17;
|
|
1548
|
+
return this.client.AccessType({
|
|
1549
|
+
id: id
|
|
1550
|
+
});
|
|
1466
1551
|
|
|
1467
|
-
|
|
1468
|
-
|
|
1552
|
+
case 17:
|
|
1553
|
+
_context15.t0 = _context15.sent;
|
|
1554
|
+
|
|
1555
|
+
if (!(_context15.t0 === "group")) {
|
|
1556
|
+
_context15.next = 22;
|
|
1557
|
+
break;
|
|
1558
|
+
}
|
|
1469
1559
|
|
|
1470
|
-
|
|
1471
|
-
_context15.next =
|
|
1560
|
+
subjectId = "igrp".concat(this.client.utils.AddressToHash(subjectId));
|
|
1561
|
+
_context15.next = 23;
|
|
1472
1562
|
break;
|
|
1473
|
-
}
|
|
1474
1563
|
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1564
|
+
case 22:
|
|
1565
|
+
subjectId = "iusr".concat(this.client.utils.AddressToHash(subjectId));
|
|
1566
|
+
|
|
1567
|
+
case 23:
|
|
1568
|
+
_context15.next = 25;
|
|
1569
|
+
return Promise.all(permissions.map( /*#__PURE__*/function () {
|
|
1570
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(permission, index) {
|
|
1571
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
1572
|
+
while (1) {
|
|
1573
|
+
switch (_context14.prev = _context14.next) {
|
|
1574
|
+
case 0:
|
|
1575
|
+
if (!(permission.subject.id === subjectId || permission.subject.oauth_id === subjectId)) {
|
|
1576
|
+
_context14.next = 3;
|
|
1577
|
+
break;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
_context14.next = 3;
|
|
1581
|
+
return _this4.client.DeleteMetadata({
|
|
1582
|
+
libraryId: policyLibraryId,
|
|
1583
|
+
objectId: policyId,
|
|
1584
|
+
writeToken: policyWriteToken,
|
|
1585
|
+
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions", index.toString())
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
case 3:
|
|
1589
|
+
case "end":
|
|
1590
|
+
return _context14.stop();
|
|
1492
1591
|
}
|
|
1592
|
+
}
|
|
1593
|
+
}, _callee14);
|
|
1594
|
+
}));
|
|
1595
|
+
|
|
1596
|
+
return function (_x15, _x16) {
|
|
1597
|
+
return _ref15.apply(this, arguments);
|
|
1598
|
+
};
|
|
1599
|
+
}()));
|
|
1600
|
+
|
|
1601
|
+
case 25:
|
|
1602
|
+
case "end":
|
|
1603
|
+
return _context15.stop();
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}, _callee15, this);
|
|
1607
|
+
}));
|
|
1493
1608
|
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
objectId: policyId,
|
|
1498
|
-
writeToken: policyWriteToken,
|
|
1499
|
-
metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions", index.toString())
|
|
1500
|
-
}));
|
|
1501
|
-
|
|
1502
|
-
case 3:
|
|
1503
|
-
case "end":
|
|
1504
|
-
return _context14.stop();
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
});
|
|
1508
|
-
})));
|
|
1609
|
+
function RemovePermission(_x14) {
|
|
1610
|
+
return _RemovePermission.apply(this, arguments);
|
|
1611
|
+
}
|
|
1509
1612
|
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
return _context15.stop();
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
}, null, this);
|
|
1516
|
-
}
|
|
1613
|
+
return RemovePermission;
|
|
1614
|
+
}()
|
|
1517
1615
|
/**
|
|
1518
1616
|
* Retrieve all permissions for the specified subject.
|
|
1519
1617
|
*
|
|
@@ -1528,124 +1626,138 @@ function () {
|
|
|
1528
1626
|
|
|
1529
1627
|
}, {
|
|
1530
1628
|
key: "SubjectPermissions",
|
|
1531
|
-
value: function
|
|
1532
|
-
var
|
|
1629
|
+
value: function () {
|
|
1630
|
+
var _SubjectPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref16) {
|
|
1631
|
+
var _this5 = this;
|
|
1632
|
+
|
|
1633
|
+
var policyId, policyWriteToken, subjectId, id, policyLibraryId, policy, allSubjectPermissions, _i, _Object$keys, itemId, itemPermissions, subjectPermissions;
|
|
1634
|
+
|
|
1635
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1636
|
+
while (1) {
|
|
1637
|
+
switch (_context17.prev = _context17.next) {
|
|
1638
|
+
case 0:
|
|
1639
|
+
policyId = _ref16.policyId, policyWriteToken = _ref16.policyWriteToken, subjectId = _ref16.subjectId;
|
|
1640
|
+
ValidatePresence("policyId", policyId);
|
|
1641
|
+
ValidatePresence("subjectId", subjectId); // Convert address to appropriate ID
|
|
1642
|
+
|
|
1643
|
+
if (!subjectId.startsWith("0x")) {
|
|
1644
|
+
_context17.next = 13;
|
|
1645
|
+
break;
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
id = this.client.utils.AddressToObjectId(subjectId);
|
|
1649
|
+
_context17.next = 7;
|
|
1650
|
+
return this.client.AccessType({
|
|
1651
|
+
id: id
|
|
1652
|
+
});
|
|
1533
1653
|
|
|
1534
|
-
|
|
1654
|
+
case 7:
|
|
1655
|
+
_context17.t0 = _context17.sent;
|
|
1535
1656
|
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
policyId = _ref14.policyId, policyWriteToken = _ref14.policyWriteToken, subjectId = _ref14.subjectId;
|
|
1541
|
-
ValidatePresence("policyId", policyId);
|
|
1542
|
-
ValidatePresence("subjectId", subjectId); // Convert address to appropriate ID
|
|
1657
|
+
if (!(_context17.t0 === "group")) {
|
|
1658
|
+
_context17.next = 12;
|
|
1659
|
+
break;
|
|
1660
|
+
}
|
|
1543
1661
|
|
|
1544
|
-
|
|
1662
|
+
subjectId = "igrp".concat(this.client.utils.AddressToHash(subjectId));
|
|
1545
1663
|
_context17.next = 13;
|
|
1546
1664
|
break;
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
id = this.client.utils.AddressToObjectId(subjectId);
|
|
1550
|
-
_context17.next = 7;
|
|
1551
|
-
return _regeneratorRuntime.awrap(this.client.AccessType({
|
|
1552
|
-
id: id
|
|
1553
|
-
}));
|
|
1554
1665
|
|
|
1555
|
-
|
|
1556
|
-
|
|
1666
|
+
case 12:
|
|
1667
|
+
subjectId = "iusr".concat(this.client.utils.AddressToHash(subjectId));
|
|
1557
1668
|
|
|
1558
|
-
|
|
1559
|
-
_context17.next =
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
subjectId = "igrp".concat(this.client.utils.AddressToHash(subjectId));
|
|
1564
|
-
_context17.next = 13;
|
|
1565
|
-
break;
|
|
1566
|
-
|
|
1567
|
-
case 12:
|
|
1568
|
-
subjectId = "iusr".concat(this.client.utils.AddressToHash(subjectId));
|
|
1569
|
-
|
|
1570
|
-
case 13:
|
|
1571
|
-
_context17.next = 15;
|
|
1572
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectLibraryId({
|
|
1573
|
-
objectId: policyId
|
|
1574
|
-
}));
|
|
1575
|
-
|
|
1576
|
-
case 15:
|
|
1577
|
-
policyLibraryId = _context17.sent;
|
|
1578
|
-
_context17.next = 18;
|
|
1579
|
-
return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
|
|
1580
|
-
libraryId: policyLibraryId,
|
|
1581
|
-
objectId: policyId,
|
|
1582
|
-
writeToken: policyWriteToken,
|
|
1583
|
-
metadataSubtree: UrlJoin("auth_policy_spec")
|
|
1584
|
-
}));
|
|
1585
|
-
|
|
1586
|
-
case 18:
|
|
1587
|
-
policy = _context17.sent;
|
|
1588
|
-
allSubjectPermissions = {};
|
|
1589
|
-
_i = 0, _Object$keys = Object.keys(policy);
|
|
1590
|
-
|
|
1591
|
-
case 21:
|
|
1592
|
-
if (!(_i < _Object$keys.length)) {
|
|
1593
|
-
_context17.next = 31;
|
|
1594
|
-
break;
|
|
1595
|
-
}
|
|
1669
|
+
case 13:
|
|
1670
|
+
_context17.next = 15;
|
|
1671
|
+
return this.client.ContentObjectLibraryId({
|
|
1672
|
+
objectId: policyId
|
|
1673
|
+
});
|
|
1596
1674
|
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
switch (_context16.prev = _context16.next) {
|
|
1606
|
-
case 0:
|
|
1607
|
-
_context16.next = 2;
|
|
1608
|
-
return _regeneratorRuntime.awrap(_this5.FormatPermission({
|
|
1609
|
-
policyId: policyId,
|
|
1610
|
-
policyWriteToken: policyWriteToken,
|
|
1611
|
-
permission: permission
|
|
1612
|
-
}));
|
|
1613
|
-
|
|
1614
|
-
case 2:
|
|
1615
|
-
return _context16.abrupt("return", _context16.sent);
|
|
1616
|
-
|
|
1617
|
-
case 3:
|
|
1618
|
-
case "end":
|
|
1619
|
-
return _context16.stop();
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1675
|
+
case 15:
|
|
1676
|
+
policyLibraryId = _context17.sent;
|
|
1677
|
+
_context17.next = 18;
|
|
1678
|
+
return this.client.ContentObjectMetadata({
|
|
1679
|
+
libraryId: policyLibraryId,
|
|
1680
|
+
objectId: policyId,
|
|
1681
|
+
writeToken: policyWriteToken,
|
|
1682
|
+
metadataSubtree: UrlJoin("auth_policy_spec")
|
|
1622
1683
|
});
|
|
1623
|
-
})));
|
|
1624
1684
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1685
|
+
case 18:
|
|
1686
|
+
policy = _context17.sent;
|
|
1687
|
+
allSubjectPermissions = {};
|
|
1688
|
+
_i = 0, _Object$keys = Object.keys(policy);
|
|
1627
1689
|
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1690
|
+
case 21:
|
|
1691
|
+
if (!(_i < _Object$keys.length)) {
|
|
1692
|
+
_context17.next = 31;
|
|
1693
|
+
break;
|
|
1694
|
+
}
|
|
1633
1695
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1696
|
+
itemId = _Object$keys[_i];
|
|
1697
|
+
itemPermissions = policy[itemId].permissions || [];
|
|
1698
|
+
_context17.next = 26;
|
|
1699
|
+
return Promise.all(itemPermissions.filter(function (permission) {
|
|
1700
|
+
return (permission.subject || {}).oauth_id === subjectId || (permission.subject || {}).id === subjectId;
|
|
1701
|
+
}).map( /*#__PURE__*/function () {
|
|
1702
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(permission) {
|
|
1703
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
1704
|
+
while (1) {
|
|
1705
|
+
switch (_context16.prev = _context16.next) {
|
|
1706
|
+
case 0:
|
|
1707
|
+
_context16.next = 2;
|
|
1708
|
+
return _this5.FormatPermission({
|
|
1709
|
+
policyId: policyId,
|
|
1710
|
+
policyWriteToken: policyWriteToken,
|
|
1711
|
+
permission: permission
|
|
1712
|
+
});
|
|
1713
|
+
|
|
1714
|
+
case 2:
|
|
1715
|
+
return _context16.abrupt("return", _context16.sent);
|
|
1716
|
+
|
|
1717
|
+
case 3:
|
|
1718
|
+
case "end":
|
|
1719
|
+
return _context16.stop();
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
}, _callee16);
|
|
1723
|
+
}));
|
|
1724
|
+
|
|
1725
|
+
return function (_x18) {
|
|
1726
|
+
return _ref17.apply(this, arguments);
|
|
1727
|
+
};
|
|
1728
|
+
}()));
|
|
1729
|
+
|
|
1730
|
+
case 26:
|
|
1731
|
+
subjectPermissions = _context17.sent;
|
|
1732
|
+
|
|
1733
|
+
if (subjectPermissions.length > 0) {
|
|
1734
|
+
allSubjectPermissions[itemId] = _objectSpread(_objectSpread({}, policy[itemId]), {}, {
|
|
1735
|
+
permissions: subjectPermissions
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1638
1738
|
|
|
1639
|
-
|
|
1640
|
-
|
|
1739
|
+
case 28:
|
|
1740
|
+
_i++;
|
|
1741
|
+
_context17.next = 21;
|
|
1742
|
+
break;
|
|
1641
1743
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1744
|
+
case 31:
|
|
1745
|
+
return _context17.abrupt("return", allSubjectPermissions);
|
|
1746
|
+
|
|
1747
|
+
case 32:
|
|
1748
|
+
case "end":
|
|
1749
|
+
return _context17.stop();
|
|
1750
|
+
}
|
|
1645
1751
|
}
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1752
|
+
}, _callee17, this);
|
|
1753
|
+
}));
|
|
1754
|
+
|
|
1755
|
+
function SubjectPermissions(_x17) {
|
|
1756
|
+
return _SubjectPermissions.apply(this, arguments);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
return SubjectPermissions;
|
|
1760
|
+
}()
|
|
1649
1761
|
/**
|
|
1650
1762
|
* Remove all permissions for the specified subject.
|
|
1651
1763
|
*
|
|
@@ -1658,56 +1770,70 @@ function () {
|
|
|
1658
1770
|
|
|
1659
1771
|
}, {
|
|
1660
1772
|
key: "RemoveSubjectPermissions",
|
|
1661
|
-
value: function
|
|
1662
|
-
var
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
case 6:
|
|
1681
|
-
subjectPermissions = _context19.sent;
|
|
1682
|
-
_context19.next = 9;
|
|
1683
|
-
return _regeneratorRuntime.awrap(this.client.utils.LimitedMap(5, Object.keys(subjectPermissions), function _callee4(itemId) {
|
|
1684
|
-
return _regeneratorRuntime.async(function _callee4$(_context18) {
|
|
1685
|
-
while (1) {
|
|
1686
|
-
switch (_context18.prev = _context18.next) {
|
|
1687
|
-
case 0:
|
|
1688
|
-
_context18.next = 2;
|
|
1689
|
-
return _regeneratorRuntime.awrap(_this6.RemovePermission({
|
|
1690
|
-
policyId: policyId,
|
|
1691
|
-
policyWriteToken: policyWriteToken,
|
|
1692
|
-
subjectId: subjectId,
|
|
1693
|
-
itemId: itemId
|
|
1694
|
-
}));
|
|
1695
|
-
|
|
1696
|
-
case 2:
|
|
1697
|
-
case "end":
|
|
1698
|
-
return _context18.stop();
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1773
|
+
value: function () {
|
|
1774
|
+
var _RemoveSubjectPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref18) {
|
|
1775
|
+
var _this6 = this;
|
|
1776
|
+
|
|
1777
|
+
var policyId, policyWriteToken, subjectId, subjectPermissions;
|
|
1778
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1779
|
+
while (1) {
|
|
1780
|
+
switch (_context19.prev = _context19.next) {
|
|
1781
|
+
case 0:
|
|
1782
|
+
policyId = _ref18.policyId, policyWriteToken = _ref18.policyWriteToken, subjectId = _ref18.subjectId;
|
|
1783
|
+
ValidatePresence("policyId", policyId);
|
|
1784
|
+
ValidatePresence("policyWriteToken", policyWriteToken);
|
|
1785
|
+
ValidatePresence("subjectId", subjectId);
|
|
1786
|
+
_context19.next = 6;
|
|
1787
|
+
return this.SubjectPermissions({
|
|
1788
|
+
policyId: policyId,
|
|
1789
|
+
policyWriteToken: policyWriteToken,
|
|
1790
|
+
subjectId: subjectId
|
|
1701
1791
|
});
|
|
1702
|
-
}));
|
|
1703
1792
|
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1793
|
+
case 6:
|
|
1794
|
+
subjectPermissions = _context19.sent;
|
|
1795
|
+
_context19.next = 9;
|
|
1796
|
+
return this.client.utils.LimitedMap(5, Object.keys(subjectPermissions), /*#__PURE__*/function () {
|
|
1797
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(itemId) {
|
|
1798
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1799
|
+
while (1) {
|
|
1800
|
+
switch (_context18.prev = _context18.next) {
|
|
1801
|
+
case 0:
|
|
1802
|
+
_context18.next = 2;
|
|
1803
|
+
return _this6.RemovePermission({
|
|
1804
|
+
policyId: policyId,
|
|
1805
|
+
policyWriteToken: policyWriteToken,
|
|
1806
|
+
subjectId: subjectId,
|
|
1807
|
+
itemId: itemId
|
|
1808
|
+
});
|
|
1809
|
+
|
|
1810
|
+
case 2:
|
|
1811
|
+
case "end":
|
|
1812
|
+
return _context18.stop();
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
}, _callee18);
|
|
1816
|
+
}));
|
|
1817
|
+
|
|
1818
|
+
return function (_x20) {
|
|
1819
|
+
return _ref19.apply(this, arguments);
|
|
1820
|
+
};
|
|
1821
|
+
}());
|
|
1822
|
+
|
|
1823
|
+
case 9:
|
|
1824
|
+
case "end":
|
|
1825
|
+
return _context19.stop();
|
|
1826
|
+
}
|
|
1707
1827
|
}
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1828
|
+
}, _callee19, this);
|
|
1829
|
+
}));
|
|
1830
|
+
|
|
1831
|
+
function RemoveSubjectPermissions(_x19) {
|
|
1832
|
+
return _RemoveSubjectPermissions.apply(this, arguments);
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
return RemoveSubjectPermissions;
|
|
1836
|
+
}()
|
|
1711
1837
|
}]);
|
|
1712
1838
|
|
|
1713
1839
|
return PermissionsClient;
|