Sharing files in private folders programmatically (React/JavaScript)

AFAIK I don’t know of any comprehensive guide to sharing resources in Solid =/

There is a tutorial on how to use the sharing pane in the data browser to grant others access to resources that might be of interest, and there is of course the code behind the pane itself if you want to see how it handles it.

The Solid React SDK has Access Control on its roadmap, but that part of it is not available yet.

I really think I need to write a tutorial on how to do resource sharing programmatically… When I have time :stuck_out_tongue: Until then I can recommend reading up on the specification (Web Access Control), that covers how Solid servers should implement access control.

If you want to see some examples I recommend setting up a server and look at the templates that are provided for new user PODs:

None of these resources show how a resource is shared with another specific WebID. But to give you an idea, here is my generated file for test.txt.acl that I created locally:

@prefix : <#>.
@prefix n0: <http://www.w3.org/ns/auth/acl#>.
@prefix c: </profile/card#>.
@prefix c0: <https://megoth-test3.dev.inrupt.net/profile/card#>.

:ControlReadWrite
    a n0:Authorization;
    n0:accessTo <test.txt>;
    n0:agent c:me;
    n0:mode n0:Control, n0:Read, n0:Write.
:Read a n0:Authorization; n0:accessTo <test.txt>; n0:agent c0:me; n0:mode n0:Read.

Hope this is of help :slight_smile: I’ll let you know if I’m ever able to write tutorial :wink:

4 Likes