In this quick start, you will use a Fedora 4 server with the WebAC Authorization module enabled to create a sample resource and an ACL for that resource, verify that access to that resource is correctly restricted, and finally modify the ACL to allow you to update the resource.
Prerequisites
- Fedora 4 with WebAC module enabled (you can use one of the pre-built WAR files from the fcrepo-webapp-plus project)a running Fedora repository
- curl
The commands in this guide assume that your Fedora 4 repository root is running at http://localhost:8080/fcrepo/rest.
Steps
Create these two files in a local directory:
Panel | ||
---|---|---|
| ||
|
...
Then run this to attempt to update foo
:
Code Block | ||
---|---|---|
| ||
$ curl -i -X PATCH http://localhost:8080/fcrepo/rest/foo -u user1:password1 \
-H "Content-Type: application/sparql-update" \
--data-binary @foo.sparql |
...
Run this command to update the ACL authorization:
Code Block | ||
---|---|---|
| ||
$ curl -i -X PATCH http://localhost:8080/fcrepo/rest/acl/authz -u admin1:password3 \
-H "Content-Type: application/sparql-update" \
--data-binary @authz.sparql |
...
Now you should be able to re-run the earlier command to update the foo
resource as user1
:
Code Block | ||
---|---|---|
| ||
$ curl -i -X PATCH http://localhost:8080/fcrepo/rest/foo -u user1:password1 \
-H "Content-Type: application/sparql-update" \
--data-binary @foo.sparql |
...