@qikdev/sdk 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +1 -1
  2. package/dist/access.html +16371 -0
  3. package/dist/api.html +1503 -0
  4. package/dist/auth.html +8455 -0
  5. package/dist/cache.html +1135 -0
  6. package/dist/content.html +10067 -0
  7. package/dist/files.html +3415 -0
  8. package/dist/filter.html +4973 -0
  9. package/dist/geo.html +3851 -0
  10. package/dist/global.html +328 -0
  11. package/dist/index.html +96 -0
  12. package/dist/main.js +1100 -1126
  13. package/dist/module-QikStorage-CookieStorageAdapter.html +1177 -0
  14. package/dist/module-QikStorage-LocalStorageAdapter.html +329 -0
  15. package/dist/module-QikStorage-StorageAdapter.html +3457 -0
  16. package/dist/module-QikStorage.html +1445 -0
  17. package/dist/qik.access.js.html +904 -0
  18. package/dist/qik.api.js.html +409 -0
  19. package/dist/{docs/qik.auth.js.html → qik.auth.js.html} +142 -104
  20. package/dist/qik.cache.js.html +125 -0
  21. package/dist/qik.content.js.html +967 -0
  22. package/dist/qik.core.js.html +322 -0
  23. package/dist/qik.files.js.html +249 -0
  24. package/dist/{docs/qik.filter.js.html → qik.filter.js.html} +2 -2
  25. package/dist/qik.geo.js.html +963 -0
  26. package/dist/qik.socket.js.html +451 -0
  27. package/dist/qik.storage.js.html +375 -0
  28. package/dist/qik.system.js.html +117 -0
  29. package/dist/qik.utils.js.html +1542 -0
  30. package/dist/socket.html +2975 -0
  31. package/dist/{docs/styles → styles}/jsdoc.css +2 -2
  32. package/dist/system.html +523 -0
  33. package/package.json +2 -2
  34. package/src/api/qik.access.js +2 -53
  35. package/src/api/qik.socket.js +51 -10
  36. package/src/version.js +1 -1
  37. package/dist/docs/access.html +0 -3826
  38. package/dist/docs/api.html +0 -1356
  39. package/dist/docs/auth.html +0 -2180
  40. package/dist/docs/cache.html +0 -351
  41. package/dist/docs/content.html +0 -2560
  42. package/dist/docs/files.html +0 -779
  43. package/dist/docs/filter.html +0 -1355
  44. package/dist/docs/index.html +0 -96
  45. package/dist/docs/qik.access.js.html +0 -790
  46. package/dist/docs/qik.api.js.html +0 -511
  47. package/dist/docs/qik.cache.js.html +0 -131
  48. package/dist/docs/qik.content.js.html +0 -918
  49. package/dist/docs/qik.core.js.html +0 -301
  50. package/dist/docs/qik.files.js.html +0 -219
  51. package/dist/docs/qik.socket.js.html +0 -416
  52. package/dist/docs/qik.system.js.html +0 -117
  53. package/dist/docs/qik.utils.js.html +0 -1467
  54. package/dist/docs/socket.html +0 -810
  55. package/dist/docs/system.html +0 -197
  56. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.eot +0 -0
  57. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.ttf +0 -0
  58. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.woff +0 -0
  59. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Bold.woff2 +0 -0
  60. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.eot +0 -0
  61. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.ttf +0 -0
  62. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.woff +0 -0
  63. /package/dist/{docs/fonts → fonts}/Montserrat/Montserrat-Regular.woff2 +0 -0
  64. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  65. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.svg +0 -0
  66. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  67. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  68. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  69. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  70. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +0 -0
  71. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  72. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  73. /package/dist/{docs/fonts → fonts}/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  74. /package/dist/{docs/scripts → scripts}/collapse.js +0 -0
  75. /package/dist/{docs/scripts → scripts}/linenumber.js +0 -0
  76. /package/dist/{docs/scripts → scripts}/nav.js +0 -0
  77. /package/dist/{docs/scripts → scripts}/polyfill.js +0 -0
  78. /package/dist/{docs/scripts → scripts}/prettify/Apache-License-2.0.txt +0 -0
  79. /package/dist/{docs/scripts → scripts}/prettify/lang-css.js +0 -0
  80. /package/dist/{docs/scripts → scripts}/prettify/prettify.js +0 -0
  81. /package/dist/{docs/scripts → scripts}/search.js +0 -0
  82. /package/dist/{docs/styles → styles}/prettify.css +0 -0
@@ -1,3826 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
-
5
- <meta charset="utf-8">
6
- <title>access - Documentation</title>
7
-
8
-
9
- <script src="scripts/prettify/prettify.js"></script>
10
- <script src="scripts/prettify/lang-css.js"></script>
11
- <!--[if lt IE 9]>
12
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
- <![endif]-->
14
- <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
- <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
- <script src="scripts/nav.js" defer></script>
17
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
- </head>
19
- <body>
20
-
21
- <input type="checkbox" id="nav-trigger" class="nav-trigger" />
22
- <label for="nav-trigger" class="navicon-button x">
23
- <div class="navicon"></div>
24
- </label>
25
-
26
- <label for="nav-trigger" class="overlay"></label>
27
-
28
- <nav >
29
-
30
- <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="access.html">access</a><ul class='methods'><li data-type='method'><a href="access.html#.actionableScopes">actionableScopes</a></li><li data-type='method'><a href="access.html#.allPermissions">allPermissions</a></li><li data-type='method'><a href="access.html#.allPermissionTypes">allPermissionTypes</a></li><li data-type='method'><a href="access.html#.allUserScopes">allUserScopes</a></li><li data-type='method'><a href="access.html#.canCreate">canCreate</a></li><li data-type='method'><a href="access.html#.canDeleteItem">canDeleteItem</a></li><li data-type='method'><a href="access.html#.canEditItem">canEditItem</a></li><li data-type='method'><a href="access.html#.canEraseItem">canEraseItem</a></li><li data-type='method'><a href="access.html#.canKnowOf">canKnowOf</a></li><li data-type='method'><a href="access.html#.canListItem">canListItem</a></li><li data-type='method'><a href="access.html#.canRestoreItem">canRestoreItem</a></li><li data-type='method'><a href="access.html#.canViewItem">canViewItem</a></li><li data-type='method'><a href="access.html#.checkActionAccess">checkActionAccess</a></li><li data-type='method'><a href="access.html#.getAllDescendants">getAllDescendants</a></li><li data-type='method'><a href="access.html#.has">has</a></li><li data-type='method'><a href="access.html#.hashPermissions">hashPermissions</a></li><li data-type='method'><a href="access.html#.isAdministrator">isAdministrator</a></li><li data-type='method'><a href="access.html#.isOwner">isOwner</a></li></ul></li><li><a href="api.html">api</a><ul class='methods'><li data-type='method'><a href="api.html#.delete">delete</a></li><li data-type='method'><a href="api.html#.generateEndpointURL">generateEndpointURL</a></li><li data-type='method'><a href="api.html#.get">get</a></li><li data-type='method'><a href="api.html#.patch">patch</a></li><li data-type='method'><a href="api.html#.post">post</a></li><li data-type='method'><a href="api.html#.put">put</a></li></ul></li><li><a href="auth.html">auth</a><ul class='methods'><li data-type='method'><a href="auth.html#.changeOrganisation">changeOrganisation</a></li><li data-type='method'><a href="auth.html#.ensureValidToken">ensureValidToken</a></li><li data-type='method'><a href="auth.html#.getCurrentToken">getCurrentToken</a></li><li data-type='method'><a href="auth.html#.getCurrentUser">getCurrentUser</a></li><li data-type='method'><a href="auth.html#.impersonate">impersonate</a></li><li data-type='method'><a href="auth.html#.login">login</a></li><li data-type='method'><a href="auth.html#.logout">logout</a></li><li data-type='method'><a href="auth.html#.retrieveUserFromResetToken">retrieveUserFromResetToken</a></li><li data-type='method'><a href="auth.html#.sendResetPasswordRequest">sendResetPasswordRequest</a></li><li data-type='method'><a href="auth.html#.set">set</a></li><li data-type='method'><a href="auth.html#.sync">sync</a></li><li data-type='method'><a href="auth.html#.updateUserWithToken">updateUserWithToken</a></li></ul></li><li><a href="cache.html">cache</a><ul class='methods'><li data-type='method'><a href="cache.html#.get">get</a></li><li data-type='method'><a href="cache.html#.reset">reset</a></li></ul></li><li><a href="content.html">content</a><ul class='methods'><li data-type='method'><a href="content.html#.create">create</a></li><li data-type='method'><a href="content.html#.delete">delete</a></li><li data-type='method'><a href="content.html#.get">get</a></li><li data-type='method'><a href="content.html#.getFromSlug">getFromSlug</a></li><li data-type='method'><a href="content.html#.glossary">glossary</a></li><li data-type='method'><a href="content.html#.list">list</a></li><li data-type='method'><a href="content.html#.patch">patch</a></li><li data-type='method'><a href="content.html#.restore">restore</a></li><li data-type='method'><a href="content.html#.scopeGlossary">scopeGlossary</a></li><li data-type='method'><a href="content.html#.update">update</a></li><li data-type='method'><a href="content.html#.validateField">validateField</a></li><li data-type='method'><a href="content.html#.variables">variables</a></li></ul></li><li><a href="files.html">files</a><ul class='methods'><li data-type='method'><a href="files.html#.downloadUrl">downloadUrl</a></li><li data-type='method'><a href="files.html#.filesize">filesize</a></li><li data-type='method'><a href="files.html#.getBinaryTypeFromMime">getBinaryTypeFromMime</a></li><li data-type='method'><a href="files.html#.mediaUrl">mediaUrl</a></li></ul></li><li><a href="filter.html">filter</a><ul class='methods'><li data-type='method'><a href="filter.html#.activeFilterKeys">activeFilterKeys</a></li><li data-type='method'><a href="filter.html#.activeFilterKeys">activeFilterKeys</a></li><li data-type='method'><a href="filter.html#.activeFilterOperators">activeFilterOperators</a></li><li data-type='method'><a href="filter.html#.activeFilters">activeFilters</a></li><li data-type='method'><a href="filter.html#.activeFilterValues">activeFilterValues</a></li><li data-type='method'><a href="filter.html#.filterChangeString">filterChangeString</a></li><li data-type='method'><a href="filter.html#.isValidFilter">isValidFilter</a></li></ul></li><li><a href="socket.html">socket</a><ul class='methods'><li data-type='method'><a href="socket.html#.channel">channel</a></li><li data-type='method'><a href="socket.html#.close">close</a></li><li data-type='method'><a href="socket.html#.connect">connect</a></li><li data-type='method'><a href="socket.html#.reconnect">reconnect</a></li><li data-type='method'><a href="socket.html#.subscribe">subscribe</a></li><li data-type='method'><a href="socket.html#.unsubscribe">unsubscribe</a></li></ul></li><li><a href="system.html">system</a><ul class='methods'><li data-type='method'><a href="system.html#.countries">countries</a></li></ul></li></ul>
31
- </nav>
32
-
33
- <div id="main">
34
-
35
- <h1 class="page-title">access</h1>
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
- <section>
44
-
45
- <header>
46
-
47
- <h2>
48
- access
49
- </h2>
50
-
51
-
52
- </header>
53
-
54
- <article>
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
- <h3 class="subsection-title">Methods</h3>
73
-
74
-
75
-
76
-
77
-
78
-
79
- <h4 class="name" id=".actionableScopes"><span class="type-signature">(static) </span>actionableScopes<span class="signature">(user, action, definition, type, options)</span><span class="type-signature"></span></h4>
80
-
81
-
82
-
83
-
84
-
85
-
86
- <dl class="details">
87
-
88
-
89
- <dt class="tag-source">Source:</dt>
90
- <dd class="tag-source"><ul class="dummy"><li>
91
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line179">line 179</a>
92
- </li></ul></dd>
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
- </dl>
125
-
126
-
127
-
128
-
129
-
130
- <div class="description usertext">
131
- Return an array of all scopes that a given user can perform a specified action in
132
- </div>
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
-
141
-
142
- <h5>Example</h5>
143
-
144
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
145
- const canCreateInScopes = sdk.access.actionableScopes(user, 'create', 'car', 'article');
146
- const canDeleteInScopes = sdk.access.actionableScopes(user, 'delete', 'profile');
147
-
148
- // Would result in something like:
149
- ['61eca4746971e75c1fc670cf', '61eca4746971e75c1fc670ca', '77eca4746971e75c1fc670cf'],</code></pre>
150
-
151
-
152
-
153
-
154
- <h5>Parameters:</h5>
155
-
156
-
157
- <table class="params">
158
- <thead>
159
- <tr>
160
-
161
- <th>Name</th>
162
-
163
-
164
- <th>Type</th>
165
-
166
-
167
-
168
-
169
-
170
- <th class="last">Description</th>
171
- </tr>
172
- </thead>
173
-
174
- <tbody>
175
-
176
-
177
- <tr>
178
-
179
- <td class="name"><code>user</code></td>
180
-
181
-
182
- <td class="type">
183
-
184
-
185
- <span class="param-type">Object</span>
186
-
187
-
188
-
189
- </td>
190
-
191
-
192
-
193
-
194
-
195
- <td class="description last">A user session object</td>
196
- </tr>
197
-
198
-
199
-
200
- <tr>
201
-
202
- <td class="name"><code>action</code></td>
203
-
204
-
205
- <td class="type">
206
-
207
-
208
- <span class="param-type">String</span>
209
-
210
-
211
-
212
- </td>
213
-
214
-
215
-
216
-
217
-
218
- <td class="description last">The action</td>
219
- </tr>
220
-
221
-
222
-
223
- <tr>
224
-
225
- <td class="name"><code>definition</code></td>
226
-
227
-
228
- <td class="type">
229
-
230
-
231
- <span class="param-type">String</span>
232
-
233
-
234
-
235
- </td>
236
-
237
-
238
-
239
-
240
-
241
- <td class="description last">The defined type of item the action will be performed on</td>
242
- </tr>
243
-
244
-
245
-
246
- <tr>
247
-
248
- <td class="name"><code>type</code></td>
249
-
250
-
251
- <td class="type">
252
-
253
-
254
- <span class="param-type">String</span>
255
-
256
-
257
-
258
- </td>
259
-
260
-
261
-
262
-
263
-
264
- <td class="description last">The basic type of item the action will be performed on</td>
265
- </tr>
266
-
267
-
268
-
269
- <tr>
270
-
271
- <td class="name"><code>options</code></td>
272
-
273
-
274
- <td class="type">
275
-
276
-
277
- <span class="param-type">Object</span>
278
-
279
-
280
-
281
- </td>
282
-
283
-
284
-
285
-
286
-
287
- <td class="description last">Additional options and parameters</td>
288
- </tr>
289
-
290
-
291
- </tbody>
292
- </table>
293
-
294
-
295
-
296
-
297
-
298
-
299
-
300
-
301
-
302
-
303
-
304
-
305
-
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
-
314
-
315
-
316
-
317
- <h4 class="name" id=".allPermissions"><span class="type-signature">(static) </span>allPermissions<span class="signature">(user)</span><span class="type-signature"></span></h4>
318
-
319
-
320
-
321
-
322
-
323
-
324
- <dl class="details">
325
-
326
-
327
- <dt class="tag-source">Source:</dt>
328
- <dd class="tag-source"><ul class="dummy"><li>
329
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line269">line 269</a>
330
- </li></ul></dd>
331
-
332
-
333
-
334
-
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
-
345
-
346
-
347
-
348
-
349
-
350
-
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
- </dl>
363
-
364
-
365
-
366
-
367
-
368
- <div class="description usertext">
369
- Returns an array of all permissions a given user has access to
370
- </div>
371
-
372
-
373
-
374
-
375
-
376
-
377
-
378
-
379
-
380
- <h5>Example</h5>
381
-
382
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
383
- const permissions = sdk.access.allPermissions(user);
384
-
385
- // Returns
386
- ['image.viewany', 'testimonial.viewany', 'testimonial.viewfield.title', ...]</code></pre>
387
-
388
-
389
-
390
-
391
- <h5>Parameters:</h5>
392
-
393
-
394
- <table class="params">
395
- <thead>
396
- <tr>
397
-
398
- <th>Name</th>
399
-
400
-
401
- <th>Type</th>
402
-
403
-
404
-
405
-
406
-
407
- <th class="last">Description</th>
408
- </tr>
409
- </thead>
410
-
411
- <tbody>
412
-
413
-
414
- <tr>
415
-
416
- <td class="name"><code>user</code></td>
417
-
418
-
419
- <td class="type">
420
-
421
-
422
- <span class="param-type">Object</span>
423
-
424
-
425
-
426
- </td>
427
-
428
-
429
-
430
-
431
-
432
- <td class="description last">The user to check</td>
433
- </tr>
434
-
435
-
436
- </tbody>
437
- </table>
438
-
439
-
440
-
441
-
442
-
443
-
444
-
445
-
446
-
447
-
448
-
449
-
450
-
451
-
452
-
453
-
454
-
455
-
456
-
457
-
458
-
459
-
460
-
461
-
462
- <h4 class="name" id=".allPermissionTypes"><span class="type-signature">(static) </span>allPermissionTypes<span class="signature">(user, asHash)</span><span class="type-signature"></span></h4>
463
-
464
-
465
-
466
-
467
-
468
-
469
- <dl class="details">
470
-
471
-
472
- <dt class="tag-source">Source:</dt>
473
- <dd class="tag-source"><ul class="dummy"><li>
474
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line297">line 297</a>
475
- </li></ul></dd>
476
-
477
-
478
-
479
-
480
-
481
-
482
-
483
-
484
-
485
-
486
-
487
-
488
-
489
-
490
-
491
-
492
-
493
-
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
- </dl>
508
-
509
-
510
-
511
-
512
-
513
- <div class="description usertext">
514
- Returns an array of content types a given user has permission to interact with
515
- </div>
516
-
517
-
518
-
519
-
520
-
521
-
522
-
523
-
524
-
525
- <h5>Example</h5>
526
-
527
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
528
-
529
- // Returns ['image', 'testimonial']
530
- const types = sdk.access.allPermissionTypes(user);
531
-
532
- // Returns {image:true, testimonial:true}
533
- const types = sdk.access.allPermissionTypes(user, true);</code></pre>
534
-
535
-
536
-
537
-
538
- <h5>Parameters:</h5>
539
-
540
-
541
- <table class="params">
542
- <thead>
543
- <tr>
544
-
545
- <th>Name</th>
546
-
547
-
548
- <th>Type</th>
549
-
550
-
551
-
552
-
553
-
554
- <th class="last">Description</th>
555
- </tr>
556
- </thead>
557
-
558
- <tbody>
559
-
560
-
561
- <tr>
562
-
563
- <td class="name"><code>user</code></td>
564
-
565
-
566
- <td class="type">
567
-
568
-
569
- <span class="param-type">Object</span>
570
-
571
-
572
-
573
- </td>
574
-
575
-
576
-
577
-
578
-
579
- <td class="description last">The user to check</td>
580
- </tr>
581
-
582
-
583
-
584
- <tr>
585
-
586
- <td class="name"><code>asHash</code></td>
587
-
588
-
589
- <td class="type">
590
-
591
-
592
- <span class="param-type">Boolean</span>
593
-
594
-
595
-
596
- </td>
597
-
598
-
599
-
600
-
601
-
602
- <td class="description last">Whether to retrieve the result as a keyed object hash, by default
603
- the response will be an array</td>
604
- </tr>
605
-
606
-
607
- </tbody>
608
- </table>
609
-
610
-
611
-
612
-
613
-
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
-
624
-
625
-
626
-
627
-
628
-
629
-
630
-
631
-
632
-
633
- <h4 class="name" id=".allUserScopes"><span class="type-signature">(static) </span>allUserScopes<span class="signature">(user)</span><span class="type-signature"></span></h4>
634
-
635
-
636
-
637
-
638
-
639
-
640
- <dl class="details">
641
-
642
-
643
- <dt class="tag-source">Source:</dt>
644
- <dd class="tag-source"><ul class="dummy"><li>
645
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line121">line 121</a>
646
- </li></ul></dd>
647
-
648
-
649
-
650
-
651
-
652
-
653
-
654
-
655
-
656
-
657
-
658
-
659
-
660
-
661
-
662
-
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
-
678
- </dl>
679
-
680
-
681
-
682
-
683
-
684
- <div class="description usertext">
685
- Return an array of ids of all scopes that a given user has been granted a permission in
686
- </div>
687
-
688
-
689
-
690
-
691
-
692
-
693
-
694
-
695
-
696
- <h5>Example</h5>
697
-
698
- <pre class="prettyprint"><code>const permissions = sdk.access.allUserScopes({firstName:'Mighty', lastName:'Mouse', permissionSets:[...], ...});
699
-
700
- // Would result in:
701
- ['61eca4746971e75c1fc670cf', '61eca4746971e75c1fc670ca', '77eca4746971e75c1fc670cf'],</code></pre>
702
-
703
-
704
-
705
-
706
- <h5>Parameters:</h5>
707
-
708
-
709
- <table class="params">
710
- <thead>
711
- <tr>
712
-
713
- <th>Name</th>
714
-
715
-
716
- <th>Type</th>
717
-
718
-
719
-
720
-
721
-
722
- <th class="last">Description</th>
723
- </tr>
724
- </thead>
725
-
726
- <tbody>
727
-
728
-
729
- <tr>
730
-
731
- <td class="name"><code>user</code></td>
732
-
733
-
734
- <td class="type">
735
-
736
-
737
- <span class="param-type">Object</span>
738
-
739
-
740
-
741
- </td>
742
-
743
-
744
-
745
-
746
-
747
- <td class="description last">A user session object</td>
748
- </tr>
749
-
750
-
751
- </tbody>
752
- </table>
753
-
754
-
755
-
756
-
757
-
758
-
759
-
760
-
761
-
762
-
763
-
764
-
765
-
766
-
767
-
768
-
769
-
770
-
771
-
772
-
773
-
774
-
775
-
776
-
777
- <h4 class="name" id=".canCreate"><span class="type-signature">(static) </span>canCreate<span class="signature">(user, definition, type, options)</span><span class="type-signature"></span></h4>
778
-
779
-
780
-
781
-
782
-
783
-
784
- <dl class="details">
785
-
786
-
787
- <dt class="tag-source">Source:</dt>
788
- <dd class="tag-source"><ul class="dummy"><li>
789
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line489">line 489</a>
790
- </li></ul></dd>
791
-
792
-
793
-
794
-
795
-
796
-
797
-
798
-
799
-
800
-
801
-
802
-
803
-
804
-
805
-
806
-
807
-
808
-
809
-
810
-
811
-
812
-
813
-
814
-
815
-
816
-
817
-
818
-
819
-
820
-
821
-
822
- </dl>
823
-
824
-
825
-
826
-
827
-
828
- <div class="description usertext">
829
- Helpful function for checking whether a given user can create a specified type of item
830
- </div>
831
-
832
-
833
-
834
-
835
-
836
-
837
-
838
-
839
-
840
- <h5>Example</h5>
841
-
842
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
843
- const userCanCreateShortFilms = sdk.access.canCreate(user, 'shortFilm', 'video');</code></pre>
844
-
845
-
846
-
847
-
848
- <h5>Parameters:</h5>
849
-
850
-
851
- <table class="params">
852
- <thead>
853
- <tr>
854
-
855
- <th>Name</th>
856
-
857
-
858
- <th>Type</th>
859
-
860
-
861
-
862
-
863
-
864
- <th class="last">Description</th>
865
- </tr>
866
- </thead>
867
-
868
- <tbody>
869
-
870
-
871
- <tr>
872
-
873
- <td class="name"><code>user</code></td>
874
-
875
-
876
- <td class="type">
877
-
878
-
879
- <span class="param-type">Object</span>
880
-
881
-
882
-
883
- </td>
884
-
885
-
886
-
887
-
888
-
889
- <td class="description last">The user to check</td>
890
- </tr>
891
-
892
-
893
-
894
- <tr>
895
-
896
- <td class="name"><code>definition</code></td>
897
-
898
-
899
- <td class="type">
900
-
901
-
902
- <span class="param-type">String</span>
903
-
904
-
905
-
906
- </td>
907
-
908
-
909
-
910
-
911
-
912
- <td class="description last">The defined type key</td>
913
- </tr>
914
-
915
-
916
-
917
- <tr>
918
-
919
- <td class="name"><code>type</code></td>
920
-
921
-
922
- <td class="type">
923
-
924
-
925
- <span class="param-type">String</span>
926
-
927
-
928
-
929
- </td>
930
-
931
-
932
-
933
-
934
-
935
- <td class="description last">The basic type key</td>
936
- </tr>
937
-
938
-
939
-
940
- <tr>
941
-
942
- <td class="name"><code>options</code></td>
943
-
944
-
945
- <td class="type">
946
-
947
-
948
- <span class="param-type">Object</span>
949
-
950
-
951
-
952
- </td>
953
-
954
-
955
-
956
-
957
-
958
- <td class="description last">Additional options and parameters
959
- <h6>Properties</h6>
960
-
961
-
962
- <table class="params">
963
- <thead>
964
- <tr>
965
-
966
- <th>Name</th>
967
-
968
-
969
- <th>Type</th>
970
-
971
-
972
-
973
-
974
-
975
- <th class="last">Description</th>
976
- </tr>
977
- </thead>
978
-
979
- <tbody>
980
-
981
-
982
- <tr>
983
-
984
- <td class="name"><code>cache</code></td>
985
-
986
-
987
- <td class="type">
988
-
989
-
990
- <span class="param-type">Object</span>
991
-
992
-
993
-
994
- </td>
995
-
996
-
997
-
998
-
999
-
1000
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
1001
- </tr>
1002
-
1003
-
1004
- </tbody>
1005
- </table>
1006
-
1007
- </td>
1008
- </tr>
1009
-
1010
-
1011
- </tbody>
1012
- </table>
1013
-
1014
-
1015
-
1016
-
1017
-
1018
-
1019
-
1020
-
1021
-
1022
-
1023
-
1024
-
1025
-
1026
-
1027
-
1028
-
1029
-
1030
-
1031
-
1032
-
1033
-
1034
-
1035
-
1036
-
1037
- <h4 class="name" id=".canDeleteItem"><span class="type-signature">(static) </span>canDeleteItem<span class="signature">(user, item, options)</span><span class="type-signature"></span></h4>
1038
-
1039
-
1040
-
1041
-
1042
-
1043
-
1044
- <dl class="details">
1045
-
1046
-
1047
- <dt class="tag-source">Source:</dt>
1048
- <dd class="tag-source"><ul class="dummy"><li>
1049
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line647">line 647</a>
1050
- </li></ul></dd>
1051
-
1052
-
1053
-
1054
-
1055
-
1056
-
1057
-
1058
-
1059
-
1060
-
1061
-
1062
-
1063
-
1064
-
1065
-
1066
-
1067
-
1068
-
1069
-
1070
-
1071
-
1072
-
1073
-
1074
-
1075
-
1076
-
1077
-
1078
-
1079
-
1080
-
1081
-
1082
- </dl>
1083
-
1084
-
1085
-
1086
-
1087
-
1088
- <div class="description usertext">
1089
- Helpful function for checking whether a given user can delete a specified item
1090
- </div>
1091
-
1092
-
1093
-
1094
-
1095
-
1096
-
1097
-
1098
-
1099
-
1100
- <h5>Example</h5>
1101
-
1102
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
1103
-
1104
- // Example of looping through a large array of items
1105
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
1106
-
1107
- // Create an in memory cache object outside of the loop
1108
- const cache = {}
1109
-
1110
- const filtered = largeArrayOfItems.filter(function(item) {
1111
- return sdk.access.canDeleteItem(user, item, {cache});
1112
- })</code></pre>
1113
-
1114
-
1115
-
1116
-
1117
- <h5>Parameters:</h5>
1118
-
1119
-
1120
- <table class="params">
1121
- <thead>
1122
- <tr>
1123
-
1124
- <th>Name</th>
1125
-
1126
-
1127
- <th>Type</th>
1128
-
1129
-
1130
-
1131
-
1132
-
1133
- <th class="last">Description</th>
1134
- </tr>
1135
- </thead>
1136
-
1137
- <tbody>
1138
-
1139
-
1140
- <tr>
1141
-
1142
- <td class="name"><code>user</code></td>
1143
-
1144
-
1145
- <td class="type">
1146
-
1147
-
1148
- <span class="param-type">Object</span>
1149
-
1150
-
1151
-
1152
- </td>
1153
-
1154
-
1155
-
1156
-
1157
-
1158
- <td class="description last">The user to check</td>
1159
- </tr>
1160
-
1161
-
1162
-
1163
- <tr>
1164
-
1165
- <td class="name"><code>item</code></td>
1166
-
1167
-
1168
- <td class="type">
1169
-
1170
-
1171
- <span class="param-type">Object</span>
1172
-
1173
-
1174
-
1175
- </td>
1176
-
1177
-
1178
-
1179
-
1180
-
1181
- <td class="description last">The item to check</td>
1182
- </tr>
1183
-
1184
-
1185
-
1186
- <tr>
1187
-
1188
- <td class="name"><code>options</code></td>
1189
-
1190
-
1191
- <td class="type">
1192
-
1193
-
1194
- <span class="param-type">Object</span>
1195
-
1196
-
1197
-
1198
- </td>
1199
-
1200
-
1201
-
1202
-
1203
-
1204
- <td class="description last">Additional options and parameters
1205
- <h6>Properties</h6>
1206
-
1207
-
1208
- <table class="params">
1209
- <thead>
1210
- <tr>
1211
-
1212
- <th>Name</th>
1213
-
1214
-
1215
- <th>Type</th>
1216
-
1217
-
1218
-
1219
-
1220
-
1221
- <th class="last">Description</th>
1222
- </tr>
1223
- </thead>
1224
-
1225
- <tbody>
1226
-
1227
-
1228
- <tr>
1229
-
1230
- <td class="name"><code>cache</code></td>
1231
-
1232
-
1233
- <td class="type">
1234
-
1235
-
1236
- <span class="param-type">Object</span>
1237
-
1238
-
1239
-
1240
- </td>
1241
-
1242
-
1243
-
1244
-
1245
-
1246
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
1247
- </tr>
1248
-
1249
-
1250
- </tbody>
1251
- </table>
1252
-
1253
- </td>
1254
- </tr>
1255
-
1256
-
1257
- </tbody>
1258
- </table>
1259
-
1260
-
1261
-
1262
-
1263
-
1264
-
1265
-
1266
-
1267
-
1268
-
1269
-
1270
-
1271
-
1272
-
1273
-
1274
-
1275
-
1276
-
1277
-
1278
-
1279
-
1280
-
1281
-
1282
-
1283
- <h4 class="name" id=".canEditItem"><span class="type-signature">(static) </span>canEditItem<span class="signature">(user, item, options)</span><span class="type-signature"></span></h4>
1284
-
1285
-
1286
-
1287
-
1288
-
1289
-
1290
- <dl class="details">
1291
-
1292
-
1293
- <dt class="tag-source">Source:</dt>
1294
- <dd class="tag-source"><ul class="dummy"><li>
1295
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line617">line 617</a>
1296
- </li></ul></dd>
1297
-
1298
-
1299
-
1300
-
1301
-
1302
-
1303
-
1304
-
1305
-
1306
-
1307
-
1308
-
1309
-
1310
-
1311
-
1312
-
1313
-
1314
-
1315
-
1316
-
1317
-
1318
-
1319
-
1320
-
1321
-
1322
-
1323
-
1324
-
1325
-
1326
-
1327
-
1328
- </dl>
1329
-
1330
-
1331
-
1332
-
1333
-
1334
- <div class="description usertext">
1335
- Helpful function for checking whether a given user can edit a specified item
1336
- </div>
1337
-
1338
-
1339
-
1340
-
1341
-
1342
-
1343
-
1344
-
1345
-
1346
- <h5>Example</h5>
1347
-
1348
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
1349
-
1350
- // Example of looping through a large array of items
1351
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
1352
-
1353
- // Create an in memory cache object outside of the loop
1354
- const cache = {}
1355
-
1356
- const filtered = largeArrayOfItems.filter(function(item) {
1357
- return sdk.access.canEditItem(user, item, {cache});
1358
- })</code></pre>
1359
-
1360
-
1361
-
1362
-
1363
- <h5>Parameters:</h5>
1364
-
1365
-
1366
- <table class="params">
1367
- <thead>
1368
- <tr>
1369
-
1370
- <th>Name</th>
1371
-
1372
-
1373
- <th>Type</th>
1374
-
1375
-
1376
-
1377
-
1378
-
1379
- <th class="last">Description</th>
1380
- </tr>
1381
- </thead>
1382
-
1383
- <tbody>
1384
-
1385
-
1386
- <tr>
1387
-
1388
- <td class="name"><code>user</code></td>
1389
-
1390
-
1391
- <td class="type">
1392
-
1393
-
1394
- <span class="param-type">Object</span>
1395
-
1396
-
1397
-
1398
- </td>
1399
-
1400
-
1401
-
1402
-
1403
-
1404
- <td class="description last">The user to check</td>
1405
- </tr>
1406
-
1407
-
1408
-
1409
- <tr>
1410
-
1411
- <td class="name"><code>item</code></td>
1412
-
1413
-
1414
- <td class="type">
1415
-
1416
-
1417
- <span class="param-type">Object</span>
1418
-
1419
-
1420
-
1421
- </td>
1422
-
1423
-
1424
-
1425
-
1426
-
1427
- <td class="description last">The item to check</td>
1428
- </tr>
1429
-
1430
-
1431
-
1432
- <tr>
1433
-
1434
- <td class="name"><code>options</code></td>
1435
-
1436
-
1437
- <td class="type">
1438
-
1439
-
1440
- <span class="param-type">Object</span>
1441
-
1442
-
1443
-
1444
- </td>
1445
-
1446
-
1447
-
1448
-
1449
-
1450
- <td class="description last">Additional options and parameters
1451
- <h6>Properties</h6>
1452
-
1453
-
1454
- <table class="params">
1455
- <thead>
1456
- <tr>
1457
-
1458
- <th>Name</th>
1459
-
1460
-
1461
- <th>Type</th>
1462
-
1463
-
1464
-
1465
-
1466
-
1467
- <th class="last">Description</th>
1468
- </tr>
1469
- </thead>
1470
-
1471
- <tbody>
1472
-
1473
-
1474
- <tr>
1475
-
1476
- <td class="name"><code>cache</code></td>
1477
-
1478
-
1479
- <td class="type">
1480
-
1481
-
1482
- <span class="param-type">Object</span>
1483
-
1484
-
1485
-
1486
- </td>
1487
-
1488
-
1489
-
1490
-
1491
-
1492
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
1493
- </tr>
1494
-
1495
-
1496
- </tbody>
1497
- </table>
1498
-
1499
- </td>
1500
- </tr>
1501
-
1502
-
1503
- </tbody>
1504
- </table>
1505
-
1506
-
1507
-
1508
-
1509
-
1510
-
1511
-
1512
-
1513
-
1514
-
1515
-
1516
-
1517
-
1518
-
1519
-
1520
-
1521
-
1522
-
1523
-
1524
-
1525
-
1526
-
1527
-
1528
-
1529
- <h4 class="name" id=".canEraseItem"><span class="type-signature">(static) </span>canEraseItem<span class="signature">(user, item, options)</span><span class="type-signature"></span></h4>
1530
-
1531
-
1532
-
1533
-
1534
-
1535
-
1536
- <dl class="details">
1537
-
1538
-
1539
- <dt class="tag-source">Source:</dt>
1540
- <dd class="tag-source"><ul class="dummy"><li>
1541
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line705">line 705</a>
1542
- </li></ul></dd>
1543
-
1544
-
1545
-
1546
-
1547
-
1548
-
1549
-
1550
-
1551
-
1552
-
1553
-
1554
-
1555
-
1556
-
1557
-
1558
-
1559
-
1560
-
1561
-
1562
-
1563
-
1564
-
1565
-
1566
-
1567
-
1568
-
1569
-
1570
-
1571
-
1572
-
1573
-
1574
- </dl>
1575
-
1576
-
1577
-
1578
-
1579
-
1580
- <div class="description usertext">
1581
- Helpful function for checking whether a given user can erase a specified item
1582
- </div>
1583
-
1584
-
1585
-
1586
-
1587
-
1588
-
1589
-
1590
-
1591
-
1592
- <h5>Example</h5>
1593
-
1594
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
1595
-
1596
- // Example of looping through a large array of items
1597
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
1598
-
1599
- // Create an in memory cache object outside of the loop
1600
- const cache = {}
1601
-
1602
- const filtered = largeArrayOfItems.filter(function(item) {
1603
- return sdk.access.canEraseItem(user, item, {cache});
1604
- })</code></pre>
1605
-
1606
-
1607
-
1608
-
1609
- <h5>Parameters:</h5>
1610
-
1611
-
1612
- <table class="params">
1613
- <thead>
1614
- <tr>
1615
-
1616
- <th>Name</th>
1617
-
1618
-
1619
- <th>Type</th>
1620
-
1621
-
1622
-
1623
-
1624
-
1625
- <th class="last">Description</th>
1626
- </tr>
1627
- </thead>
1628
-
1629
- <tbody>
1630
-
1631
-
1632
- <tr>
1633
-
1634
- <td class="name"><code>user</code></td>
1635
-
1636
-
1637
- <td class="type">
1638
-
1639
-
1640
- <span class="param-type">Object</span>
1641
-
1642
-
1643
-
1644
- </td>
1645
-
1646
-
1647
-
1648
-
1649
-
1650
- <td class="description last">The user to check</td>
1651
- </tr>
1652
-
1653
-
1654
-
1655
- <tr>
1656
-
1657
- <td class="name"><code>item</code></td>
1658
-
1659
-
1660
- <td class="type">
1661
-
1662
-
1663
- <span class="param-type">Object</span>
1664
-
1665
-
1666
-
1667
- </td>
1668
-
1669
-
1670
-
1671
-
1672
-
1673
- <td class="description last">The item to check</td>
1674
- </tr>
1675
-
1676
-
1677
-
1678
- <tr>
1679
-
1680
- <td class="name"><code>options</code></td>
1681
-
1682
-
1683
- <td class="type">
1684
-
1685
-
1686
- <span class="param-type">Object</span>
1687
-
1688
-
1689
-
1690
- </td>
1691
-
1692
-
1693
-
1694
-
1695
-
1696
- <td class="description last">Additional options and parameters
1697
- <h6>Properties</h6>
1698
-
1699
-
1700
- <table class="params">
1701
- <thead>
1702
- <tr>
1703
-
1704
- <th>Name</th>
1705
-
1706
-
1707
- <th>Type</th>
1708
-
1709
-
1710
-
1711
-
1712
-
1713
- <th class="last">Description</th>
1714
- </tr>
1715
- </thead>
1716
-
1717
- <tbody>
1718
-
1719
-
1720
- <tr>
1721
-
1722
- <td class="name"><code>cache</code></td>
1723
-
1724
-
1725
- <td class="type">
1726
-
1727
-
1728
- <span class="param-type">Object</span>
1729
-
1730
-
1731
-
1732
- </td>
1733
-
1734
-
1735
-
1736
-
1737
-
1738
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
1739
- </tr>
1740
-
1741
-
1742
- </tbody>
1743
- </table>
1744
-
1745
- </td>
1746
- </tr>
1747
-
1748
-
1749
- </tbody>
1750
- </table>
1751
-
1752
-
1753
-
1754
-
1755
-
1756
-
1757
-
1758
-
1759
-
1760
-
1761
-
1762
-
1763
-
1764
-
1765
-
1766
-
1767
-
1768
-
1769
-
1770
-
1771
-
1772
-
1773
-
1774
-
1775
- <h4 class="name" id=".canKnowOf"><span class="type-signature">(static) </span>canKnowOf<span class="signature">(user, typeKey, options)</span><span class="type-signature"></span></h4>
1776
-
1777
-
1778
-
1779
-
1780
-
1781
-
1782
- <dl class="details">
1783
-
1784
-
1785
- <dt class="tag-source">Source:</dt>
1786
- <dd class="tag-source"><ul class="dummy"><li>
1787
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line326">line 326</a>
1788
- </li></ul></dd>
1789
-
1790
-
1791
-
1792
-
1793
-
1794
-
1795
-
1796
-
1797
-
1798
-
1799
-
1800
-
1801
-
1802
-
1803
-
1804
-
1805
-
1806
-
1807
-
1808
-
1809
-
1810
-
1811
-
1812
-
1813
-
1814
-
1815
-
1816
-
1817
-
1818
-
1819
-
1820
- </dl>
1821
-
1822
-
1823
-
1824
-
1825
-
1826
- <div class="description usertext">
1827
- Checks if a user has any permissions relating to a specified type of content
1828
- </div>
1829
-
1830
-
1831
-
1832
-
1833
-
1834
-
1835
-
1836
-
1837
-
1838
- <h5>Example</h5>
1839
-
1840
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
1841
- const canAccessImageSection = sdk.access.canKnowOf(user, 'image');
1842
- const canAccessCustomerUploadSection = sdk.access.canKnowOf(user, 'customerUpload');</code></pre>
1843
-
1844
-
1845
-
1846
-
1847
- <h5>Parameters:</h5>
1848
-
1849
-
1850
- <table class="params">
1851
- <thead>
1852
- <tr>
1853
-
1854
- <th>Name</th>
1855
-
1856
-
1857
- <th>Type</th>
1858
-
1859
-
1860
-
1861
-
1862
-
1863
- <th class="last">Description</th>
1864
- </tr>
1865
- </thead>
1866
-
1867
- <tbody>
1868
-
1869
-
1870
- <tr>
1871
-
1872
- <td class="name"><code>user</code></td>
1873
-
1874
-
1875
- <td class="type">
1876
-
1877
-
1878
- <span class="param-type">Object</span>
1879
-
1880
-
1881
-
1882
- </td>
1883
-
1884
-
1885
-
1886
-
1887
-
1888
- <td class="description last">The user to check</td>
1889
- </tr>
1890
-
1891
-
1892
-
1893
- <tr>
1894
-
1895
- <td class="name"><code>typeKey</code></td>
1896
-
1897
-
1898
- <td class="type">
1899
-
1900
-
1901
- <span class="param-type">String</span>
1902
-
1903
-
1904
-
1905
- </td>
1906
-
1907
-
1908
-
1909
-
1910
-
1911
- <td class="description last">The type or definition to check</td>
1912
- </tr>
1913
-
1914
-
1915
-
1916
- <tr>
1917
-
1918
- <td class="name"><code>options</code></td>
1919
-
1920
-
1921
- <td class="type">
1922
-
1923
-
1924
- <span class="param-type">Object</span>
1925
-
1926
-
1927
-
1928
- </td>
1929
-
1930
-
1931
-
1932
-
1933
-
1934
- <td class="description last">Additional options and parameters
1935
- <h6>Properties</h6>
1936
-
1937
-
1938
- <table class="params">
1939
- <thead>
1940
- <tr>
1941
-
1942
- <th>Name</th>
1943
-
1944
-
1945
- <th>Type</th>
1946
-
1947
-
1948
-
1949
-
1950
-
1951
- <th class="last">Description</th>
1952
- </tr>
1953
- </thead>
1954
-
1955
- <tbody>
1956
-
1957
-
1958
- <tr>
1959
-
1960
- <td class="name"><code>cache</code></td>
1961
-
1962
-
1963
- <td class="type">
1964
-
1965
-
1966
- <span class="param-type">Object</span>
1967
-
1968
-
1969
-
1970
- </td>
1971
-
1972
-
1973
-
1974
-
1975
-
1976
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
1977
- </tr>
1978
-
1979
-
1980
- </tbody>
1981
- </table>
1982
-
1983
- </td>
1984
- </tr>
1985
-
1986
-
1987
- </tbody>
1988
- </table>
1989
-
1990
-
1991
-
1992
-
1993
-
1994
-
1995
-
1996
-
1997
-
1998
-
1999
-
2000
-
2001
-
2002
-
2003
-
2004
-
2005
-
2006
-
2007
-
2008
-
2009
-
2010
-
2011
-
2012
-
2013
- <h4 class="name" id=".canListItem"><span class="type-signature">(static) </span>canListItem<span class="signature">(user, item, options)</span><span class="type-signature"></span></h4>
2014
-
2015
-
2016
-
2017
-
2018
-
2019
-
2020
- <dl class="details">
2021
-
2022
-
2023
- <dt class="tag-source">Source:</dt>
2024
- <dd class="tag-source"><ul class="dummy"><li>
2025
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line526">line 526</a>
2026
- </li></ul></dd>
2027
-
2028
-
2029
-
2030
-
2031
-
2032
-
2033
-
2034
-
2035
-
2036
-
2037
-
2038
-
2039
-
2040
-
2041
-
2042
-
2043
-
2044
-
2045
-
2046
-
2047
-
2048
-
2049
-
2050
-
2051
-
2052
-
2053
-
2054
-
2055
-
2056
-
2057
-
2058
- </dl>
2059
-
2060
-
2061
-
2062
-
2063
-
2064
- <div class="description usertext">
2065
- Helpful function for checking whether a given user can list a specified item
2066
- </div>
2067
-
2068
-
2069
-
2070
-
2071
-
2072
-
2073
-
2074
-
2075
-
2076
- <h5>Example</h5>
2077
-
2078
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
2079
-
2080
- // Example of looping through a large array of items
2081
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
2082
-
2083
- // Create an in memory cache object outside of the loop
2084
- const cache = {}
2085
-
2086
- const filtered = largeArrayOfItems.filter(function(item) {
2087
- return sdk.access.canListItem(user, item, {cache});
2088
- })</code></pre>
2089
-
2090
-
2091
-
2092
-
2093
- <h5>Parameters:</h5>
2094
-
2095
-
2096
- <table class="params">
2097
- <thead>
2098
- <tr>
2099
-
2100
- <th>Name</th>
2101
-
2102
-
2103
- <th>Type</th>
2104
-
2105
-
2106
-
2107
-
2108
-
2109
- <th class="last">Description</th>
2110
- </tr>
2111
- </thead>
2112
-
2113
- <tbody>
2114
-
2115
-
2116
- <tr>
2117
-
2118
- <td class="name"><code>user</code></td>
2119
-
2120
-
2121
- <td class="type">
2122
-
2123
-
2124
- <span class="param-type">Object</span>
2125
-
2126
-
2127
-
2128
- </td>
2129
-
2130
-
2131
-
2132
-
2133
-
2134
- <td class="description last">The user to check</td>
2135
- </tr>
2136
-
2137
-
2138
-
2139
- <tr>
2140
-
2141
- <td class="name"><code>item</code></td>
2142
-
2143
-
2144
- <td class="type">
2145
-
2146
-
2147
- <span class="param-type">Object</span>
2148
-
2149
-
2150
-
2151
- </td>
2152
-
2153
-
2154
-
2155
-
2156
-
2157
- <td class="description last">The item to check</td>
2158
- </tr>
2159
-
2160
-
2161
-
2162
- <tr>
2163
-
2164
- <td class="name"><code>options</code></td>
2165
-
2166
-
2167
- <td class="type">
2168
-
2169
-
2170
- <span class="param-type">Object</span>
2171
-
2172
-
2173
-
2174
- </td>
2175
-
2176
-
2177
-
2178
-
2179
-
2180
- <td class="description last">Additional options and parameters
2181
- <h6>Properties</h6>
2182
-
2183
-
2184
- <table class="params">
2185
- <thead>
2186
- <tr>
2187
-
2188
- <th>Name</th>
2189
-
2190
-
2191
- <th>Type</th>
2192
-
2193
-
2194
-
2195
-
2196
-
2197
- <th class="last">Description</th>
2198
- </tr>
2199
- </thead>
2200
-
2201
- <tbody>
2202
-
2203
-
2204
- <tr>
2205
-
2206
- <td class="name"><code>cache</code></td>
2207
-
2208
-
2209
- <td class="type">
2210
-
2211
-
2212
- <span class="param-type">Object</span>
2213
-
2214
-
2215
-
2216
- </td>
2217
-
2218
-
2219
-
2220
-
2221
-
2222
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
2223
- </tr>
2224
-
2225
-
2226
- </tbody>
2227
- </table>
2228
-
2229
- </td>
2230
- </tr>
2231
-
2232
-
2233
- </tbody>
2234
- </table>
2235
-
2236
-
2237
-
2238
-
2239
-
2240
-
2241
-
2242
-
2243
-
2244
-
2245
-
2246
-
2247
-
2248
-
2249
-
2250
-
2251
-
2252
-
2253
-
2254
-
2255
-
2256
-
2257
-
2258
-
2259
- <h4 class="name" id=".canRestoreItem"><span class="type-signature">(static) </span>canRestoreItem<span class="signature">(user, item, options)</span><span class="type-signature"></span></h4>
2260
-
2261
-
2262
-
2263
-
2264
-
2265
-
2266
- <dl class="details">
2267
-
2268
-
2269
- <dt class="tag-source">Source:</dt>
2270
- <dd class="tag-source"><ul class="dummy"><li>
2271
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line676">line 676</a>
2272
- </li></ul></dd>
2273
-
2274
-
2275
-
2276
-
2277
-
2278
-
2279
-
2280
-
2281
-
2282
-
2283
-
2284
-
2285
-
2286
-
2287
-
2288
-
2289
-
2290
-
2291
-
2292
-
2293
-
2294
-
2295
-
2296
-
2297
-
2298
-
2299
-
2300
-
2301
-
2302
-
2303
-
2304
- </dl>
2305
-
2306
-
2307
-
2308
-
2309
-
2310
- <div class="description usertext">
2311
- Helpful function for checking whether a given user can restore a specified item
2312
- </div>
2313
-
2314
-
2315
-
2316
-
2317
-
2318
-
2319
-
2320
-
2321
-
2322
- <h5>Example</h5>
2323
-
2324
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
2325
-
2326
- // Example of looping through a large array of items
2327
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
2328
-
2329
- // Create an in memory cache object outside of the loop
2330
- const cache = {}
2331
-
2332
- const filtered = largeArrayOfItems.filter(function(item) {
2333
- return sdk.access.canRestoreItem(user, item, {cache});
2334
- })</code></pre>
2335
-
2336
-
2337
-
2338
-
2339
- <h5>Parameters:</h5>
2340
-
2341
-
2342
- <table class="params">
2343
- <thead>
2344
- <tr>
2345
-
2346
- <th>Name</th>
2347
-
2348
-
2349
- <th>Type</th>
2350
-
2351
-
2352
-
2353
-
2354
-
2355
- <th class="last">Description</th>
2356
- </tr>
2357
- </thead>
2358
-
2359
- <tbody>
2360
-
2361
-
2362
- <tr>
2363
-
2364
- <td class="name"><code>user</code></td>
2365
-
2366
-
2367
- <td class="type">
2368
-
2369
-
2370
- <span class="param-type">Object</span>
2371
-
2372
-
2373
-
2374
- </td>
2375
-
2376
-
2377
-
2378
-
2379
-
2380
- <td class="description last">The user to check</td>
2381
- </tr>
2382
-
2383
-
2384
-
2385
- <tr>
2386
-
2387
- <td class="name"><code>item</code></td>
2388
-
2389
-
2390
- <td class="type">
2391
-
2392
-
2393
- <span class="param-type">Object</span>
2394
-
2395
-
2396
-
2397
- </td>
2398
-
2399
-
2400
-
2401
-
2402
-
2403
- <td class="description last">The item to check</td>
2404
- </tr>
2405
-
2406
-
2407
-
2408
- <tr>
2409
-
2410
- <td class="name"><code>options</code></td>
2411
-
2412
-
2413
- <td class="type">
2414
-
2415
-
2416
- <span class="param-type">Object</span>
2417
-
2418
-
2419
-
2420
- </td>
2421
-
2422
-
2423
-
2424
-
2425
-
2426
- <td class="description last">Additional options and parameters
2427
- <h6>Properties</h6>
2428
-
2429
-
2430
- <table class="params">
2431
- <thead>
2432
- <tr>
2433
-
2434
- <th>Name</th>
2435
-
2436
-
2437
- <th>Type</th>
2438
-
2439
-
2440
-
2441
-
2442
-
2443
- <th class="last">Description</th>
2444
- </tr>
2445
- </thead>
2446
-
2447
- <tbody>
2448
-
2449
-
2450
- <tr>
2451
-
2452
- <td class="name"><code>cache</code></td>
2453
-
2454
-
2455
- <td class="type">
2456
-
2457
-
2458
- <span class="param-type">Object</span>
2459
-
2460
-
2461
-
2462
- </td>
2463
-
2464
-
2465
-
2466
-
2467
-
2468
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
2469
- </tr>
2470
-
2471
-
2472
- </tbody>
2473
- </table>
2474
-
2475
- </td>
2476
- </tr>
2477
-
2478
-
2479
- </tbody>
2480
- </table>
2481
-
2482
-
2483
-
2484
-
2485
-
2486
-
2487
-
2488
-
2489
-
2490
-
2491
-
2492
-
2493
-
2494
-
2495
-
2496
-
2497
-
2498
-
2499
-
2500
-
2501
-
2502
-
2503
-
2504
-
2505
- <h4 class="name" id=".canViewItem"><span class="type-signature">(static) </span>canViewItem<span class="signature">(user, item, options)</span><span class="type-signature"></span></h4>
2506
-
2507
-
2508
-
2509
-
2510
-
2511
-
2512
- <dl class="details">
2513
-
2514
-
2515
- <dt class="tag-source">Source:</dt>
2516
- <dd class="tag-source"><ul class="dummy"><li>
2517
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line572">line 572</a>
2518
- </li></ul></dd>
2519
-
2520
-
2521
-
2522
-
2523
-
2524
-
2525
-
2526
-
2527
-
2528
-
2529
-
2530
-
2531
-
2532
-
2533
-
2534
-
2535
-
2536
-
2537
-
2538
-
2539
-
2540
-
2541
-
2542
-
2543
-
2544
-
2545
-
2546
-
2547
-
2548
-
2549
-
2550
- </dl>
2551
-
2552
-
2553
-
2554
-
2555
-
2556
- <div class="description usertext">
2557
- Helpful function for checking whether a given user can view a specified item
2558
- </div>
2559
-
2560
-
2561
-
2562
-
2563
-
2564
-
2565
-
2566
-
2567
-
2568
- <h5>Example</h5>
2569
-
2570
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
2571
-
2572
- // Example of looping through a large array of items
2573
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
2574
-
2575
- // Create an in memory cache object outside of the loop
2576
- const cache = {}
2577
-
2578
- const filtered = largeArrayOfItems.filter(function(item) {
2579
- return sdk.access.canViewItem(user, item, {cache});
2580
- })</code></pre>
2581
-
2582
-
2583
-
2584
-
2585
- <h5>Parameters:</h5>
2586
-
2587
-
2588
- <table class="params">
2589
- <thead>
2590
- <tr>
2591
-
2592
- <th>Name</th>
2593
-
2594
-
2595
- <th>Type</th>
2596
-
2597
-
2598
-
2599
-
2600
-
2601
- <th class="last">Description</th>
2602
- </tr>
2603
- </thead>
2604
-
2605
- <tbody>
2606
-
2607
-
2608
- <tr>
2609
-
2610
- <td class="name"><code>user</code></td>
2611
-
2612
-
2613
- <td class="type">
2614
-
2615
-
2616
- <span class="param-type">Object</span>
2617
-
2618
-
2619
-
2620
- </td>
2621
-
2622
-
2623
-
2624
-
2625
-
2626
- <td class="description last">The user to check</td>
2627
- </tr>
2628
-
2629
-
2630
-
2631
- <tr>
2632
-
2633
- <td class="name"><code>item</code></td>
2634
-
2635
-
2636
- <td class="type">
2637
-
2638
-
2639
- <span class="param-type">Object</span>
2640
-
2641
-
2642
-
2643
- </td>
2644
-
2645
-
2646
-
2647
-
2648
-
2649
- <td class="description last">The item to check</td>
2650
- </tr>
2651
-
2652
-
2653
-
2654
- <tr>
2655
-
2656
- <td class="name"><code>options</code></td>
2657
-
2658
-
2659
- <td class="type">
2660
-
2661
-
2662
- <span class="param-type">Object</span>
2663
-
2664
-
2665
-
2666
- </td>
2667
-
2668
-
2669
-
2670
-
2671
-
2672
- <td class="description last">Additional options and parameters
2673
- <h6>Properties</h6>
2674
-
2675
-
2676
- <table class="params">
2677
- <thead>
2678
- <tr>
2679
-
2680
- <th>Name</th>
2681
-
2682
-
2683
- <th>Type</th>
2684
-
2685
-
2686
-
2687
-
2688
-
2689
- <th class="last">Description</th>
2690
- </tr>
2691
- </thead>
2692
-
2693
- <tbody>
2694
-
2695
-
2696
- <tr>
2697
-
2698
- <td class="name"><code>cache</code></td>
2699
-
2700
-
2701
- <td class="type">
2702
-
2703
-
2704
- <span class="param-type">Object</span>
2705
-
2706
-
2707
-
2708
- </td>
2709
-
2710
-
2711
-
2712
-
2713
-
2714
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
2715
- </tr>
2716
-
2717
-
2718
- </tbody>
2719
- </table>
2720
-
2721
- </td>
2722
- </tr>
2723
-
2724
-
2725
- </tbody>
2726
- </table>
2727
-
2728
-
2729
-
2730
-
2731
-
2732
-
2733
-
2734
-
2735
-
2736
-
2737
-
2738
-
2739
-
2740
-
2741
-
2742
-
2743
-
2744
-
2745
-
2746
-
2747
-
2748
-
2749
-
2750
-
2751
- <h4 class="name" id=".checkActionAccess"><span class="type-signature">(static) </span>checkActionAccess<span class="signature">(user, item, ANY_ACTION, OWN_ACTION, options)</span><span class="type-signature"></span></h4>
2752
-
2753
-
2754
-
2755
-
2756
-
2757
-
2758
- <dl class="details">
2759
-
2760
-
2761
- <dt class="tag-source">Source:</dt>
2762
- <dd class="tag-source"><ul class="dummy"><li>
2763
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line361">line 361</a>
2764
- </li></ul></dd>
2765
-
2766
-
2767
-
2768
-
2769
-
2770
-
2771
-
2772
-
2773
-
2774
-
2775
-
2776
-
2777
-
2778
-
2779
-
2780
-
2781
-
2782
-
2783
-
2784
-
2785
-
2786
-
2787
-
2788
-
2789
-
2790
-
2791
-
2792
-
2793
-
2794
-
2795
-
2796
- </dl>
2797
-
2798
-
2799
-
2800
-
2801
-
2802
- <div class="description usertext">
2803
- Helpful function for checking whether a given user has access to do a given action on a specified item
2804
- </div>
2805
-
2806
-
2807
-
2808
-
2809
-
2810
-
2811
-
2812
-
2813
-
2814
- <h5>Example</h5>
2815
-
2816
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
2817
- const canEditItem = sdk.access.checkActionAccess(user, {_id:'61eca4746971e75c1fc670ca', meta:{...}}, 'editany', 'editown');
2818
- const canViewItem = sdk.access.checkActionAccess(user, {_id:'61eca4746971e75c1fc670ca', meta:{...}}, 'viewany', 'viewown');
2819
-
2820
- // Example of looping through a large array of items
2821
- const largeArrayOfItems = [{_id:'...', title...}, {_id:'...', title...}...]
2822
-
2823
- // Create an in memory cache object outside of the loop
2824
- const cache = {}
2825
-
2826
- const filtered = largeArrayOfItems.filter(function(item) {
2827
- return sdk.access.checkActionAccess(user, item, 'editany', 'editown', {cache});
2828
- })</code></pre>
2829
-
2830
-
2831
-
2832
-
2833
- <h5>Parameters:</h5>
2834
-
2835
-
2836
- <table class="params">
2837
- <thead>
2838
- <tr>
2839
-
2840
- <th>Name</th>
2841
-
2842
-
2843
- <th>Type</th>
2844
-
2845
-
2846
-
2847
-
2848
-
2849
- <th class="last">Description</th>
2850
- </tr>
2851
- </thead>
2852
-
2853
- <tbody>
2854
-
2855
-
2856
- <tr>
2857
-
2858
- <td class="name"><code>user</code></td>
2859
-
2860
-
2861
- <td class="type">
2862
-
2863
-
2864
- <span class="param-type">Object</span>
2865
-
2866
-
2867
-
2868
- </td>
2869
-
2870
-
2871
-
2872
-
2873
-
2874
- <td class="description last">The user to check</td>
2875
- </tr>
2876
-
2877
-
2878
-
2879
- <tr>
2880
-
2881
- <td class="name"><code>item</code></td>
2882
-
2883
-
2884
- <td class="type">
2885
-
2886
-
2887
- <span class="param-type">Object</span>
2888
-
2889
-
2890
-
2891
- </td>
2892
-
2893
-
2894
-
2895
-
2896
-
2897
- <td class="description last">The item to check</td>
2898
- </tr>
2899
-
2900
-
2901
-
2902
- <tr>
2903
-
2904
- <td class="name"><code>ANY_ACTION</code></td>
2905
-
2906
-
2907
- <td class="type">
2908
-
2909
-
2910
- <span class="param-type">String</span>
2911
-
2912
-
2913
-
2914
- </td>
2915
-
2916
-
2917
-
2918
-
2919
-
2920
- <td class="description last">The 'any' action to check</td>
2921
- </tr>
2922
-
2923
-
2924
-
2925
- <tr>
2926
-
2927
- <td class="name"><code>OWN_ACTION</code></td>
2928
-
2929
-
2930
- <td class="type">
2931
-
2932
-
2933
- <span class="param-type">String</span>
2934
-
2935
-
2936
-
2937
- </td>
2938
-
2939
-
2940
-
2941
-
2942
-
2943
- <td class="description last">The 'owned' action to check</td>
2944
- </tr>
2945
-
2946
-
2947
-
2948
- <tr>
2949
-
2950
- <td class="name"><code>options</code></td>
2951
-
2952
-
2953
- <td class="type">
2954
-
2955
-
2956
- <span class="param-type">Object</span>
2957
-
2958
-
2959
-
2960
- </td>
2961
-
2962
-
2963
-
2964
-
2965
-
2966
- <td class="description last">Additional options and parameters
2967
- <h6>Properties</h6>
2968
-
2969
-
2970
- <table class="params">
2971
- <thead>
2972
- <tr>
2973
-
2974
- <th>Name</th>
2975
-
2976
-
2977
- <th>Type</th>
2978
-
2979
-
2980
-
2981
-
2982
-
2983
- <th class="last">Description</th>
2984
- </tr>
2985
- </thead>
2986
-
2987
- <tbody>
2988
-
2989
-
2990
- <tr>
2991
-
2992
- <td class="name"><code>cache</code></td>
2993
-
2994
-
2995
- <td class="type">
2996
-
2997
-
2998
- <span class="param-type">Object</span>
2999
-
3000
-
3001
-
3002
- </td>
3003
-
3004
-
3005
-
3006
-
3007
-
3008
- <td class="description last">Provide an existing object to use as an in memory cache, can be useful to increase performance if running this function in a large for/while loop</td>
3009
- </tr>
3010
-
3011
-
3012
- </tbody>
3013
- </table>
3014
-
3015
- </td>
3016
- </tr>
3017
-
3018
-
3019
- </tbody>
3020
- </table>
3021
-
3022
-
3023
-
3024
-
3025
-
3026
-
3027
-
3028
-
3029
-
3030
-
3031
-
3032
-
3033
-
3034
-
3035
-
3036
-
3037
-
3038
-
3039
-
3040
-
3041
-
3042
-
3043
-
3044
-
3045
- <h4 class="name" id=".getAllDescendants"><span class="type-signature">(static) </span>getAllDescendants<span class="signature">(scope)</span><span class="type-signature"></span></h4>
3046
-
3047
-
3048
-
3049
-
3050
-
3051
-
3052
- <dl class="details">
3053
-
3054
-
3055
- <dt class="tag-source">Source:</dt>
3056
- <dd class="tag-source"><ul class="dummy"><li>
3057
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line50">line 50</a>
3058
- </li></ul></dd>
3059
-
3060
-
3061
-
3062
-
3063
-
3064
-
3065
-
3066
-
3067
-
3068
-
3069
-
3070
-
3071
-
3072
-
3073
-
3074
-
3075
-
3076
-
3077
-
3078
-
3079
-
3080
-
3081
-
3082
-
3083
-
3084
-
3085
-
3086
-
3087
-
3088
-
3089
-
3090
- </dl>
3091
-
3092
-
3093
-
3094
-
3095
-
3096
- <div class="description usertext">
3097
- Get all children of a specified scope
3098
- </div>
3099
-
3100
-
3101
-
3102
-
3103
-
3104
-
3105
-
3106
-
3107
-
3108
- <h5>Example</h5>
3109
-
3110
- <pre class="prettyprint"><code>const childScopes = sdk.access.getAllDescendants({title:'Global', children:[{title:'Australia', ...}, {title:'New Zealand', ...}]});</code></pre>
3111
-
3112
-
3113
-
3114
-
3115
- <h5>Parameters:</h5>
3116
-
3117
-
3118
- <table class="params">
3119
- <thead>
3120
- <tr>
3121
-
3122
- <th>Name</th>
3123
-
3124
-
3125
- <th>Type</th>
3126
-
3127
-
3128
-
3129
-
3130
-
3131
- <th class="last">Description</th>
3132
- </tr>
3133
- </thead>
3134
-
3135
- <tbody>
3136
-
3137
-
3138
- <tr>
3139
-
3140
- <td class="name"><code>scope</code></td>
3141
-
3142
-
3143
- <td class="type">
3144
-
3145
-
3146
- <span class="param-type">Object</span>
3147
-
3148
-
3149
-
3150
- </td>
3151
-
3152
-
3153
-
3154
-
3155
-
3156
- <td class="description last">A scope object with child scopes</td>
3157
- </tr>
3158
-
3159
-
3160
- </tbody>
3161
- </table>
3162
-
3163
-
3164
-
3165
-
3166
-
3167
-
3168
-
3169
-
3170
-
3171
-
3172
-
3173
-
3174
-
3175
-
3176
-
3177
-
3178
-
3179
-
3180
-
3181
-
3182
-
3183
-
3184
-
3185
-
3186
- <h4 class="name" id=".has"><span class="type-signature">(static) </span>has<span class="signature">(user, permission)</span><span class="type-signature"></span></h4>
3187
-
3188
-
3189
-
3190
-
3191
-
3192
-
3193
- <dl class="details">
3194
-
3195
-
3196
- <dt class="tag-source">Source:</dt>
3197
- <dd class="tag-source"><ul class="dummy"><li>
3198
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line463">line 463</a>
3199
- </li></ul></dd>
3200
-
3201
-
3202
-
3203
-
3204
-
3205
-
3206
-
3207
-
3208
-
3209
-
3210
-
3211
-
3212
-
3213
-
3214
-
3215
-
3216
-
3217
-
3218
-
3219
-
3220
-
3221
-
3222
-
3223
-
3224
-
3225
-
3226
-
3227
-
3228
-
3229
-
3230
-
3231
- </dl>
3232
-
3233
-
3234
-
3235
-
3236
-
3237
- <div class="description usertext">
3238
- Helpful function for checking whether a given user has a specified permission
3239
- </div>
3240
-
3241
-
3242
-
3243
-
3244
-
3245
-
3246
-
3247
-
3248
-
3249
- <h5>Example</h5>
3250
-
3251
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
3252
- const isAllowedToCreateItems = sdk.access.has(user, 'video.create');</code></pre>
3253
-
3254
-
3255
-
3256
-
3257
- <h5>Parameters:</h5>
3258
-
3259
-
3260
- <table class="params">
3261
- <thead>
3262
- <tr>
3263
-
3264
- <th>Name</th>
3265
-
3266
-
3267
- <th>Type</th>
3268
-
3269
-
3270
-
3271
-
3272
-
3273
- <th class="last">Description</th>
3274
- </tr>
3275
- </thead>
3276
-
3277
- <tbody>
3278
-
3279
-
3280
- <tr>
3281
-
3282
- <td class="name"><code>user</code></td>
3283
-
3284
-
3285
- <td class="type">
3286
-
3287
-
3288
- <span class="param-type">Object</span>
3289
-
3290
-
3291
-
3292
- </td>
3293
-
3294
-
3295
-
3296
-
3297
-
3298
- <td class="description last">The user to check</td>
3299
- </tr>
3300
-
3301
-
3302
-
3303
- <tr>
3304
-
3305
- <td class="name"><code>permission</code></td>
3306
-
3307
-
3308
- <td class="type">
3309
-
3310
-
3311
- <span class="param-type">String</span>
3312
-
3313
-
3314
-
3315
- </td>
3316
-
3317
-
3318
-
3319
-
3320
-
3321
- <td class="description last">The permission the user may have been granted</td>
3322
- </tr>
3323
-
3324
-
3325
- </tbody>
3326
- </table>
3327
-
3328
-
3329
-
3330
-
3331
-
3332
-
3333
-
3334
-
3335
-
3336
-
3337
-
3338
-
3339
-
3340
-
3341
-
3342
-
3343
-
3344
-
3345
-
3346
-
3347
-
3348
-
3349
-
3350
-
3351
- <h4 class="name" id=".hashPermissions"><span class="type-signature">(static) </span>hashPermissions<span class="signature">(user)</span><span class="type-signature"></span></h4>
3352
-
3353
-
3354
-
3355
-
3356
-
3357
-
3358
- <dl class="details">
3359
-
3360
-
3361
- <dt class="tag-source">Source:</dt>
3362
- <dd class="tag-source"><ul class="dummy"><li>
3363
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line80">line 80</a>
3364
- </li></ul></dd>
3365
-
3366
-
3367
-
3368
-
3369
-
3370
-
3371
-
3372
-
3373
-
3374
-
3375
-
3376
-
3377
-
3378
-
3379
-
3380
-
3381
-
3382
-
3383
-
3384
-
3385
-
3386
-
3387
-
3388
-
3389
-
3390
-
3391
-
3392
-
3393
-
3394
-
3395
-
3396
- </dl>
3397
-
3398
-
3399
-
3400
-
3401
-
3402
- <div class="description usertext">
3403
- Get a lookup of all permissions a user has been granted
3404
- </div>
3405
-
3406
-
3407
-
3408
-
3409
-
3410
-
3411
-
3412
-
3413
-
3414
- <h5>Example</h5>
3415
-
3416
- <pre class="prettyprint"><code>const permissions = sdk.access.hashPermissions({firstName:'Mighty', lastName:'Mouse', permissionSets:[...], ...});</code></pre>
3417
-
3418
-
3419
-
3420
-
3421
- <h5>Parameters:</h5>
3422
-
3423
-
3424
- <table class="params">
3425
- <thead>
3426
- <tr>
3427
-
3428
- <th>Name</th>
3429
-
3430
-
3431
- <th>Type</th>
3432
-
3433
-
3434
-
3435
-
3436
-
3437
- <th class="last">Description</th>
3438
- </tr>
3439
- </thead>
3440
-
3441
- <tbody>
3442
-
3443
-
3444
- <tr>
3445
-
3446
- <td class="name"><code>user</code></td>
3447
-
3448
-
3449
- <td class="type">
3450
-
3451
-
3452
- <span class="param-type">Object</span>
3453
-
3454
-
3455
-
3456
- </td>
3457
-
3458
-
3459
-
3460
-
3461
-
3462
- <td class="description last">A user session object</td>
3463
- </tr>
3464
-
3465
-
3466
- </tbody>
3467
- </table>
3468
-
3469
-
3470
-
3471
-
3472
-
3473
-
3474
-
3475
-
3476
-
3477
-
3478
-
3479
-
3480
-
3481
-
3482
-
3483
-
3484
-
3485
-
3486
-
3487
-
3488
-
3489
-
3490
-
3491
-
3492
- <h4 class="name" id=".isAdministrator"><span class="type-signature">(static) </span>isAdministrator<span class="signature">(user)</span><span class="type-signature"></span></h4>
3493
-
3494
-
3495
-
3496
-
3497
-
3498
-
3499
- <dl class="details">
3500
-
3501
-
3502
- <dt class="tag-source">Source:</dt>
3503
- <dd class="tag-source"><ul class="dummy"><li>
3504
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line37">line 37</a>
3505
- </li></ul></dd>
3506
-
3507
-
3508
-
3509
-
3510
-
3511
-
3512
-
3513
-
3514
-
3515
-
3516
-
3517
-
3518
-
3519
-
3520
-
3521
-
3522
-
3523
-
3524
-
3525
-
3526
-
3527
-
3528
-
3529
-
3530
-
3531
-
3532
-
3533
-
3534
-
3535
-
3536
-
3537
- </dl>
3538
-
3539
-
3540
-
3541
-
3542
-
3543
- <div class="description usertext">
3544
- Check if a user object is an administrator
3545
- </div>
3546
-
3547
-
3548
-
3549
-
3550
-
3551
-
3552
-
3553
-
3554
-
3555
- <h5>Example</h5>
3556
-
3557
- <pre class="prettyprint"><code>const userIsAnAdministrator = sdk.access.isAdministrator({firstName:'Jeffrey', lastName:'Winger', ...});</code></pre>
3558
-
3559
-
3560
-
3561
-
3562
- <h5>Parameters:</h5>
3563
-
3564
-
3565
- <table class="params">
3566
- <thead>
3567
- <tr>
3568
-
3569
- <th>Name</th>
3570
-
3571
-
3572
- <th>Type</th>
3573
-
3574
-
3575
-
3576
-
3577
-
3578
- <th class="last">Description</th>
3579
- </tr>
3580
- </thead>
3581
-
3582
- <tbody>
3583
-
3584
-
3585
- <tr>
3586
-
3587
- <td class="name"><code>user</code></td>
3588
-
3589
-
3590
- <td class="type">
3591
-
3592
-
3593
- <span class="param-type">Object</span>
3594
-
3595
-
3596
-
3597
- </td>
3598
-
3599
-
3600
-
3601
-
3602
-
3603
- <td class="description last">The user session to check</td>
3604
- </tr>
3605
-
3606
-
3607
- </tbody>
3608
- </table>
3609
-
3610
-
3611
-
3612
-
3613
-
3614
-
3615
-
3616
-
3617
-
3618
-
3619
-
3620
-
3621
-
3622
-
3623
-
3624
-
3625
-
3626
-
3627
-
3628
-
3629
-
3630
-
3631
-
3632
-
3633
- <h4 class="name" id=".isOwner"><span class="type-signature">(static) </span>isOwner<span class="signature">(user, item)</span><span class="type-signature"></span></h4>
3634
-
3635
-
3636
-
3637
-
3638
-
3639
-
3640
- <dl class="details">
3641
-
3642
-
3643
- <dt class="tag-source">Source:</dt>
3644
- <dd class="tag-source"><ul class="dummy"><li>
3645
- <a href="qik.access.js.html">qik.access.js</a>, <a href="qik.access.js.html#line220">line 220</a>
3646
- </li></ul></dd>
3647
-
3648
-
3649
-
3650
-
3651
-
3652
-
3653
-
3654
-
3655
-
3656
-
3657
-
3658
-
3659
-
3660
-
3661
-
3662
-
3663
-
3664
-
3665
-
3666
-
3667
-
3668
-
3669
-
3670
-
3671
-
3672
-
3673
-
3674
-
3675
-
3676
-
3677
-
3678
- </dl>
3679
-
3680
-
3681
-
3682
-
3683
-
3684
- <div class="description usertext">
3685
- Return whether or not a user is considered an Owner of a specified item
3686
- </div>
3687
-
3688
-
3689
-
3690
-
3691
-
3692
-
3693
-
3694
-
3695
-
3696
- <h5>Example</h5>
3697
-
3698
- <pre class="prettyprint"><code>const user = sdk.auth.getCurrentUser();
3699
- const item = {title:'A piece of content', meta:{personaAuthor:'61eca4746971e75c1fc670ca'}, ...}
3700
-
3701
- // Returns true if the user owns the item
3702
- const isTheOwner = sdk.access.isOwner(user, item);</code></pre>
3703
-
3704
-
3705
-
3706
-
3707
- <h5>Parameters:</h5>
3708
-
3709
-
3710
- <table class="params">
3711
- <thead>
3712
- <tr>
3713
-
3714
- <th>Name</th>
3715
-
3716
-
3717
- <th>Type</th>
3718
-
3719
-
3720
-
3721
-
3722
-
3723
- <th class="last">Description</th>
3724
- </tr>
3725
- </thead>
3726
-
3727
- <tbody>
3728
-
3729
-
3730
- <tr>
3731
-
3732
- <td class="name"><code>user</code></td>
3733
-
3734
-
3735
- <td class="type">
3736
-
3737
-
3738
- <span class="param-type">Object</span>
3739
-
3740
-
3741
-
3742
- </td>
3743
-
3744
-
3745
-
3746
-
3747
-
3748
- <td class="description last">The user to check</td>
3749
- </tr>
3750
-
3751
-
3752
-
3753
- <tr>
3754
-
3755
- <td class="name"><code>item</code></td>
3756
-
3757
-
3758
- <td class="type">
3759
-
3760
-
3761
- <span class="param-type">Object</span>
3762
-
3763
-
3764
-
3765
- </td>
3766
-
3767
-
3768
-
3769
-
3770
-
3771
- <td class="description last">The item</td>
3772
- </tr>
3773
-
3774
-
3775
- </tbody>
3776
- </table>
3777
-
3778
-
3779
-
3780
-
3781
-
3782
-
3783
-
3784
-
3785
-
3786
-
3787
-
3788
-
3789
-
3790
-
3791
-
3792
-
3793
-
3794
-
3795
-
3796
-
3797
-
3798
-
3799
-
3800
-
3801
-
3802
- </article>
3803
-
3804
- </section>
3805
-
3806
-
3807
-
3808
-
3809
-
3810
-
3811
- </div>
3812
-
3813
- <br class="clear">
3814
-
3815
- <footer>
3816
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.11</a> on Thu Sep 28 2023 07:24:39 GMT+1000 (Australian Eastern Standard Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
3817
- </footer>
3818
-
3819
- <script>prettyPrint();</script>
3820
- <script src="scripts/polyfill.js"></script>
3821
- <script src="scripts/linenumber.js"></script>
3822
-
3823
-
3824
-
3825
- </body>
3826
- </html>