Skip to content

Instantly share code, notes, and snippets.

@yinlinchen yinlinchen/WebAC-New

Last active Apr 28, 2018
Embed
What would you like to do?
foo.ttl
```
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix dc: <http://purl.org/dc/elements/1.1/>.
<> dc:title "Hello, World!".
```
Create container
```
curl -X PUT http://localhost:8080/rest/foo -u admin1:password3 \
-H "Content-Type: text/turtle" --data-binary @foo.ttl
```
acl.ttl
```
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
<#readAccess> a acl:Authorization ;
acl:accessTo </rest/foo> ;
acl:agent "user1" ;
acl:mode acl:read .
```
Create acl
```
curl -X PUT http://localhost:8080/rest/foo/fcr:acl -u admin1:password3 \
-H "Content-Type: text/turtle" --data-binary @acl.ttl
```
authz.sparql
```
PREFIX acl: <http://www.w3.org/ns/auth/acl#>
INSERT DATA {
<#readAccess> acl:mode acl:write .
}
```
update the ACL authorization
```
curl -i -X PATCH http://localhost:8080/rest/foo/fcr:acl -u admin1:password3 \
-H "Content-Type: application/sparql-update" \
--data-binary @authz.sparql
```
@awoods

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.