How can I access the ACL for a Document created in a Container?


#1

To get the location of an existing Document’s ACL file, we look at the Link header sent when requesting that Document.

I can create a new Document by POSTing to a Container. Its response also includes a Link header; however, that points to the ACL of the Container.

Is there a way to get the ACL of that newly created Document without sending another HTTP request to that Document?


#2

Apart from a Link header, the response of the POST will also have a Location header, pointed to the newly created resource.

Retrieve that with a GET or a HEAD to get the Link header pointing you from the newly created resource to its acl.


#3

Yeah that’s what I meant by “without sending another HTTP request to that Document”, but I guess I’ll do that then :slight_smile: Thanks!


#4

You may want to look at Solid-File-Client’s getItemLinks() method which does a HEAD, finds, and parses the links.

   let links = await fc.getItemLinks( url )
   let aclLocation = links.acl