@startinblox/core 0.19.0-beta.13 → 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 +15 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11059,7 +11059,7 @@ class CustomGetter {
|
|
|
11059
11059
|
*/
|
|
11060
11060
|
async getResource(id2, context2, iriParent, forceFetch = false) {
|
|
11061
11061
|
if (id2.startsWith("_:b"))
|
|
11062
|
-
return store.get(id2);
|
|
11062
|
+
return store.get(id2 + iriParent);
|
|
11063
11063
|
return store.getData(id2, context2, iriParent, void 0, forceFetch);
|
|
11064
11064
|
}
|
|
11065
11065
|
/**
|
|
@@ -11135,21 +11135,17 @@ class CustomGetter {
|
|
|
11135
11135
|
* @returns
|
|
11136
11136
|
*/
|
|
11137
11137
|
async getPermissions() {
|
|
11138
|
-
let
|
|
11139
|
-
if (!
|
|
11140
|
-
await this.getResource(
|
|
11141
|
-
|
|
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
|
-
|
|
11144
|
-
return [];
|
|
11145
|
-
if (!Array.isArray(permissionsIds))
|
|
11146
|
-
permissionsIds = [permissionsIds];
|
|
11147
|
-
const permissions = await Promise.all(
|
|
11148
|
-
permissionsIds.map((p) => store.get(p["@id"])).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
|
|
@@ -11432,6 +11428,8 @@ class Store {
|
|
|
11432
11428
|
console.log("No key or id for resource:", resource2);
|
|
11433
11429
|
if (key === "/")
|
|
11434
11430
|
key = parentId;
|
|
11431
|
+
if (key.startsWith("_:b"))
|
|
11432
|
+
key = key + parentId;
|
|
11435
11433
|
if (key === id2 && resource2["@type"] == this.getExpandedPredicate("ldp:Container", clientContext)) {
|
|
11436
11434
|
if (serverPagination)
|
|
11437
11435
|
key = appendServerPaginationToIri(key, serverPagination);
|
|
@@ -53552,16 +53550,14 @@ const SolidAcChecker = {
|
|
|
53552
53550
|
return;
|
|
53553
53551
|
let displayElement;
|
|
53554
53552
|
const ContextParser3 = JSONLDContextParser.ContextParser;
|
|
53555
|
-
const myParser2 = new ContextParser3();
|
|
53556
|
-
const context2 = await myParser2.parse(this.context);
|
|
53557
53553
|
const permissions = await this.resource.permissions;
|
|
53558
53554
|
if (this.permission) {
|
|
53559
53555
|
displayElement = permissions.some((p) => {
|
|
53560
|
-
return ContextParser3.
|
|
53556
|
+
return ContextParser3.expandTerm(p, this.context, true) === this.permission;
|
|
53561
53557
|
});
|
|
53562
53558
|
} else if (this.noPermission) {
|
|
53563
53559
|
displayElement = permissions.every((p) => {
|
|
53564
|
-
return ContextParser3.
|
|
53560
|
+
return ContextParser3.expandTerm(p, this.context, true) !== this.noPermission;
|
|
53565
53561
|
});
|
|
53566
53562
|
} else {
|
|
53567
53563
|
console.warn('solid-ac-checker: you should define at least one of "permission" or "no-permission" attribute.');
|