@startinblox/core 0.19.0-beta.13 → 0.19.0-beta.15
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 +17 -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,19 @@ 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
|
-
if (!
|
|
11144
|
-
|
|
11145
|
-
|
|
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
|
+
if (!Array.isArray(permissions))
|
|
11149
|
+
permissions = [permissions];
|
|
11150
|
+
return permissions ? permissions : [];
|
|
11153
11151
|
}
|
|
11154
11152
|
/**
|
|
11155
11153
|
* returns compacted @type of resource
|
|
@@ -11432,6 +11430,8 @@ class Store {
|
|
|
11432
11430
|
console.log("No key or id for resource:", resource2);
|
|
11433
11431
|
if (key === "/")
|
|
11434
11432
|
key = parentId;
|
|
11433
|
+
if (key.startsWith("_:b"))
|
|
11434
|
+
key = key + parentId;
|
|
11435
11435
|
if (key === id2 && resource2["@type"] == this.getExpandedPredicate("ldp:Container", clientContext)) {
|
|
11436
11436
|
if (serverPagination)
|
|
11437
11437
|
key = appendServerPaginationToIri(key, serverPagination);
|
|
@@ -53552,16 +53552,14 @@ const SolidAcChecker = {
|
|
|
53552
53552
|
return;
|
|
53553
53553
|
let displayElement;
|
|
53554
53554
|
const ContextParser3 = JSONLDContextParser.ContextParser;
|
|
53555
|
-
const myParser2 = new ContextParser3();
|
|
53556
|
-
const context2 = await myParser2.parse(this.context);
|
|
53557
53555
|
const permissions = await this.resource.permissions;
|
|
53558
53556
|
if (this.permission) {
|
|
53559
53557
|
displayElement = permissions.some((p) => {
|
|
53560
|
-
return ContextParser3.
|
|
53558
|
+
return ContextParser3.expandTerm(p, this.context, true) === this.permission;
|
|
53561
53559
|
});
|
|
53562
53560
|
} else if (this.noPermission) {
|
|
53563
53561
|
displayElement = permissions.every((p) => {
|
|
53564
|
-
return ContextParser3.
|
|
53562
|
+
return ContextParser3.expandTerm(p, this.context, true) !== this.noPermission;
|
|
53565
53563
|
});
|
|
53566
53564
|
} else {
|
|
53567
53565
|
console.warn('solid-ac-checker: you should define at least one of "permission" or "no-permission" attribute.');
|