I want to create a new container on a Solid Inrupt Pod but with reading permissions just for my pod's friends. Nobody else can read or write data in that directory.
I've been searching and I know that I have to modify a .acl file to add permissions of reading to a current friend of mine. I share some caps:
I added uo281997 manually but I want to know how can i add it with javascript and with a list of friends. Here I share a code that creates the container but never changes the .acl permissions: Notes: friends is an array of user webIds; and webId and session of the user
async function createFriendsFolder(friends, webId, session) {
const folderUrl = webId.replace(
"/profile/card#me",
"/public/justforfriends/"
);
const folderDataset = await createContainerAt(
folderUrl,
{
fetch: session.fetch,
},
{
acl: {
read: friends,
append: [webId],
write: [webId],
control: [webId],
},
}
);
console.log("worked!");
}
Where did you get that
aclparameter from? I don't see a third parameter listed in thecreateContainerAtAPI reference.Instead you'll indeed probably want to follow the docs on changing access. You'd have to create a Dataset with an Access Control List, adding something like this:
One important caveat to this is that Inrupt's ESS server (i.e. the one at pod.inrupt.com) at the time of writing does not support this method ("WAC", Web Access Control) of access control, so it won't work there. It has its own proprietary access control protocol ("ACR", Access Control Resources), but that's not supported by other servers. There's also code that's supposed to work with both, but that doesn't due to a bug right now. So not a great situation, sorry.