@startinblox/core 0.19.0-beta.12 → 0.19.0-beta.14

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/index.js CHANGED
@@ -11135,21 +11135,17 @@ class CustomGetter {
11135
11135
  * @returns
11136
11136
  */
11137
11137
  async getPermissions() {
11138
- let permissionsIds = this.resource[this.getExpandedPredicate("permissions")];
11139
- if (!permissionsIds) {
11140
- await this.getResource(this.resourceId, { ...this.clientContext, ...this.serverContext }, this.parentId, true);
11141
- permissionsIds = this.resource[this.getExpandedPredicate("permissions")];
11138
+ let permissions = this.resource[this.getExpandedPredicate("permissions")];
11139
+ if (!permissions) {
11140
+ await this.getResource(
11141
+ this.resourceId,
11142
+ { ...this.clientContext, ...this.serverContext },
11143
+ this.parentId,
11144
+ true
11145
+ );
11146
+ permissions = this.resource[this.getExpandedPredicate("permissions")];
11142
11147
  }
11143
- if (!permissionsIds)
11144
- return [];
11145
- if (!Array.isArray(permissionsIds))
11146
- permissionsIds = [permissionsIds];
11147
- const permissions = await Promise.all(
11148
- permissionsIds.map((p) => store.get(p["@id"] + this.parentId)).map((p) => p ? p["mode.@type"] : "")
11149
- );
11150
- return permissions ? permissions.map(
11151
- (perm) => ContextParser$1.expandTerm(perm, this.serverContext, true)
11152
- ) : [];
11148
+ return permissions ? permissions : [];
11153
11149
  }
11154
11150
  /**
11155
11151
  * returns compacted @type of resource
@@ -53554,16 +53550,14 @@ const SolidAcChecker = {
53554
53550
  return;
53555
53551
  let displayElement;
53556
53552
  const ContextParser3 = JSONLDContextParser.ContextParser;
53557
- const myParser2 = new ContextParser3();
53558
- const context2 = await myParser2.parse(this.context);
53559
53553
  const permissions = await this.resource.permissions;
53560
53554
  if (this.permission) {
53561
53555
  displayElement = permissions.some((p) => {
53562
- return ContextParser3.compactIri(p, context2) === this.permission;
53556
+ return ContextParser3.expandTerm(p, this.context, true) === this.permission;
53563
53557
  });
53564
53558
  } else if (this.noPermission) {
53565
53559
  displayElement = permissions.every((p) => {
53566
- return ContextParser3.compactIri(p, context2) !== this.noPermission;
53560
+ return ContextParser3.expandTerm(p, this.context, true) !== this.noPermission;
53567
53561
  });
53568
53562
  } else {
53569
53563
  console.warn('solid-ac-checker: you should define at least one of "permission" or "no-permission" attribute.');