@qikdev/sdk 0.3.0 → 0.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qikdev/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Promise based Javascript SDK",
6
6
  "main": "./dist/main.js",
@@ -492,8 +492,28 @@ var QikAccess = function (QikCore) {
492
492
 
493
493
  //////////////////////////////////
494
494
 
495
+ //The user should be able to list any scopes that they have
496
+ //permission to do things in.
497
+ if (ANY_ACTION == "listany" || OWN_ACTION == "listown") {
498
+ if (type === "scope") {
499
+ var itemID = QikCore.utils.id(item);
500
+ return !!user.permissions[itemID];
501
+ }
502
+ }
503
+
504
+ //////////////////////////////////
505
+
495
506
  var itemScopes = QikCore.utils.ids(item.meta.scopes || []);
496
507
 
508
+ //Scopes don't have meta.scopes, instead use the scope's
509
+ //path (ancestors) plus the scope's own ID
510
+ if (type === "scope") {
511
+ itemScopes = [
512
+ ...QikCore.utils.ids(item.path || []),
513
+ QikCore.utils.id(item),
514
+ ];
515
+ }
516
+
497
517
  //////////////////////////////////
498
518
 
499
519
  var actionAnyScopesHash;
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "0.3.0";
1
+ export const version = "0.4.0";