Search terms you've used
getResourceInfoWithAccessDatasets
Bug description
The getResourceInfoWithAccessDatasets method in acp.ts does not return the access datasets as expected.
More specifically, when the resource is ACP-controlled and the policy URL is set in internal_resourceInfo.aclUrl (as is the case with f.i. the Inrupt PodSpaces)
In that case, the internal_fetchAcl method internally receives a AclIsAcrError, and results in null ACLs
|
if (e instanceof AclIsAcrError) { |
|
return { |
|
resourceAcl: null, |
|
fallbackAcl: null, |
However,
getResourceInfoWithAccessDatasets ignores the empty ACLs or the
AclIsAcrError and returns thinking it is indeed an ACL (L206), and never reaches the
fetchAcr call as it should in that case.
|
if (hasAccessibleAcl(resourceInfo)) { |
|
const acl = await internal_fetchAcl(resourceInfo, options); |
|
return internal_setAcl(resourceInfo, acl); |
|
} |
|
const acr = await fetchAcr(resourceInfo, options); |
|
return { ...resourceInfo, ...acr }; |
Expected result
Get the ACR datasets as expected when the ACP policy URL is set in internal_resourceInfo.aclUrl
Actual result
Search terms you've used
getResourceInfoWithAccessDatasets
Bug description
The
getResourceInfoWithAccessDatasetsmethod inacp.tsdoes not return the access datasets as expected.More specifically, when the resource is ACP-controlled and the policy URL is set in
internal_resourceInfo.aclUrl(as is the case with f.i. the Inrupt PodSpaces)In that case, the
internal_fetchAclmethod internally receives aAclIsAcrError, and results innullACLssolid-client-js/src/acl/acl.internal.ts
Lines 93 to 96 in 9cbd59a
However,
getResourceInfoWithAccessDatasetsignores the empty ACLs or theAclIsAcrErrorand returns thinking it is indeed an ACL (L206), and never reaches thefetchAcrcall as it should in that case.solid-client-js/src/acp/acp.ts
Lines 204 to 209 in 9cbd59a
Expected result
Get the ACR datasets as expected when the ACP policy URL is set in
internal_resourceInfo.aclUrlActual result