# How to discover ACL document of a resource using common libs

**URL:** <https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929>\
**Category:** Solid App Development FAQs\
**Created:** [April 19, 2020, 5:16pm UTC](https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929 "2020-04-19T17:16:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [April 19, 2020, 5:16pm UTC](https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929/1 "2020-04-19T17:16:08Z")

</div>

How can I find out the URI of the ACL document of a given resource? On HTTP level this means to look at the `Link` header `rel="acl"`, but how can it be done using common libraries?

- solid ldflex: [has an open issue about that](https://github.com/solid/query-ldflex/issues/48)
- rdflib.js: did not find anything… 😕
- tripledoc: There seems to be an [undocumented](https://gitter.im/solid/app-development?at=5db165871ee9bc0fca6a5fcd), experimental `getAclRef`
- what else?

How are you finding & editing ACLs in your Apps? Any tips / best practises for me?

---

<div class="post-metadata">

**Author:** ![bourgeoa](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/bourgeoa/32/291_2.png) [@bourgeoa](https://forum.solidproject.org/u/bourgeoa)\
**Post date:** [April 19, 2020, 8:28pm UTC](https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929/2 "2020-04-19T20:28:37Z")

</div>

With `solid-file-client` you can use `getItemLinks(url, options)`  
with `options.links` value being set to : `exclude`, `include` or `include_possible`  
The function returns the .meta and .acl links.

---

<div class="post-metadata">

**Author:** ![megoth](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/megoth/32/8_2.png) [@megoth](https://forum.solidproject.org/u/megoth)\
**Post date:** [April 20, 2020, 12:18am UTC](https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929/3 "2020-04-20T00:18:12Z")

</div>

You might want to check out [getACL](https://github.com/solid/solid-ui/blob/master/src/acl/acl.ts#L572) and [getACLorDefault](https://github.com/solid/solid-ui/blob/master/src/acl/acl.ts#L460) in Solid UI.

---

<div class="post-metadata">

**Author:** ![aveltens](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/aveltens/32/3987_2.png) [@aveltens](https://forum.solidproject.org/u/aveltens)\
**Post date:** [April 20, 2020, 6:03am UTC](https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929/4 "2020-04-20T06:03:46Z")

</div>

ah thanks @megoth, so this is how it can be done with rdflib since all metadata from the fetch is put into the store?

---

<div class="post-metadata">

**Author:** ![megoth](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.solidproject.org/megoth/32/8_2.png) [@megoth](https://forum.solidproject.org/u/megoth)\
**Post date:** [April 20, 2020, 6:42am UTC](https://forum.solidproject.org/t/how-to-discover-acl-document-of-a-resource-using-common-libs/2929/5 "2020-04-20T06:42:30Z")

</div>

Yes, these methods use [the global store in Solid UI](https://github.com/solid/solid-ui/blob/master/src/store.js), referenced as [kb in line 581 for `getACL`](https://github.com/solid/solid-ui/blob/master/src/acl/acl.ts#L581), which has a fetcher-property that updates the store when used. That behavior allows us to query for the ACL-resource using [http://www.iana.org/assignments/link-relations/acl](http://www.iana.org/assignments/link-relations/acl) as a predicate after we’ve fetched the original resource.

`getACLorDefault` takes this a bit further by searching for the parent ACL-resource by recursively traversing the parent containers.

Hope this is of help 😺
