The examples on this page are incompatible with Fedora 5, as they do not follow the SOLID WebAC specification. This page is being updated to bring it into alignment with the current specification
The Fedora WebAC authorization module is an implementation of the W3C's still evolving draft of an RDF-based decentralized authorization policy mechanism.
WebAccessControl is a decentralized system for allowing different users and groups various forms of access to resources where users and groups are identified by HTTP URIs.
The WebAC module will enforce access control based on the Access Control List (ACL) RDF resource associated with the requested resource. In WebAC, an ACL consists of a set of Authorizations. Each Authorization is a single rule for access, such as "users alice and bob may write to resource foo", described with a set of RDF properties. Authorizations have the RDF type http://www.w3.org/ns/auth/acl#Authorization.
For the remainder of this document, the http://www.w3.org/ns/auth/acl# namespace will be abbreviated with the prefix acl:.
Access Control Lists (ACLs)
An ACL is an RDF document (RDFSource) that contains WebAC statements that authorize access to repository resources. Each resource may have their own ACL, or implicitly be subject to the ACL of a parent container. The location of the acl for a given resource may be discovered via a Link header with relation rel=acl.
If a resource does not have an individual ACL (and therefore relies on an implicit ACL from a parent), this link header will still be present, but will return a 404. This is because the location of ACLs is solely determined by the server, much like the automatically-created LDP-RS descriptions for binary resources. The key difference is that Fedora does not create ACLs automatically, only their location.
Therefore, to discover whether a resource has an individual ACL, a client would need to:
Perform a HEAD or GET against the resource,
Find the link header
Do a GET or HEAD against the ACL location, and see if returns 200 or 404.
To create an ACL for a resource that does not already have one, a client needs to discover the ACL location (via HEAD or GET), then PUT to that location.
Authorizations
Authorizations are the permissions statements contained within an ACL document. An ACL may contain many authorizations, each of which must share the same subject. The way this is achieved is via hash URIs:
Authorization
@prefix acl: <http://www.w3.org/ns/auth/acl#>
<#auth1> a acl:Authorization .
The properties that may be used on an acl:Authorization are:
Property
Meaning
acl:accessTo
the URI of the protected resource
acl:agent
the user (in the W3C WebAC ontology, the user is named with a URI, but Fedora's implementation supports both URI- and string-based usernames)
acl:mode
the type of access (WebAC defines several modes: acl:Read, acl:Write, acl:Append, and acl:Control; Fedora implements acl:Read and acl:Write)
acl:accessToClass
an RDF class of protected resources
acl:agentGroup
a group of users (defined as a foaf:Group resource listing its users with the foaf:member property)
acl:agentClass
Identifies a class of agents, rather than a specific agent. Usage is limited to foaf:Agent (meaning "everybody"), and acl:AuthenticatedAgent (meaning "any authenticated agent").
For a more detailed explanation of Authorizations and their properties, see WebAC Authorizations.
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<> a foaf:Group;
foaf:member "editor1", "editor2".
The user userB can Read document foo (This involves setting a system property for the servlet container, e.g. -Dfcrepo.auth.webac.userAgent.baseUri=http://example.org/agents/)
A resource specifies the location of its ACL using the acl:accessControl property. If a resource itself does not specify an ACL, its parent containers are inspected, and the first specified ACL found is used as the ACL for the requested resource. If no ACLs are found, a filesystem-based ACL will be checked, the default policy of which is to deny access to the requested resource.
Example Scenarios
These scenarios assume that Fedora has been configured to use fcrepo.auth.webac.userAgent.baseUri=http://example.org/agent/ and fcrepo.auth.webac.groupAgent.baseUri=http://example.org/group/
Only the ex:publicImage type objects in the container http://localhost:8080/rest/mixedCollection are viewable by anyone, all others are only viewable by the group Admins.
Using the three "files" below to create our Authorization and ACL resources.
Acl.ttl
@prefix webac: <http://fedora.info/definitions/v4/webac#> .
<> a webac:Acl .