Skip to content

Commit dec4026

Browse files
Merge pull request #11 from solid/dz_expand_group
Expand the agentClass / Group acl definition
2 parents 3c31e71 + c7c4718 commit dec4026

File tree

1 file changed

+65
-5
lines changed

1 file changed

+65
-5
lines changed

README.md

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ is a particular subset of the options and extensions described in the wiki.
2020
4. [Representation Format](#representation-format)
2121
5. [Example WAC Document](#example-wac-document)
2222
6. [Describing Agents](#describing-agents)
23+
* [Singular Agent](#singular-agent)
24+
* [Groups](#groups-of-agents)
25+
* [Public Access (all Agents)](#public-access-all-agents)
2326
7. [Referring to Resources](#referring-to-resources)
2427
8. [Modes of Access](#modes-of-access)
2528
9. [Default (Inherited) Authorizations](#default-inherited-authorizations)
@@ -211,15 +214,69 @@ and organizations), and software agents such as applications or services.
211214

212215
An authorization may list any number of individual agents (that are being given
213216
access) by using the `acl:agent` predicate, and using their WebID URIs as
214-
objects.
217+
objects. The example WAC document in a previous section grants access to Alice,
218+
as denoted by her WebID URI, `https://alice.databox.me/profile/card#me`.
215219

216220
### Groups of Agents
217221

218-
If you need to give access to a particular group of agents, you can instead use
219-
the `acl:agentClass` predicate, and point it to a resource which lists the
220-
WebIDs of the individual members of that group.
222+
To give access to a group of agents, use the `acl:agentClass` predicate.
223+
The object of an `agentClass` statement is a hash fragment identifier that
224+
resolves to an RDF class statement in a **Group Listing** document.
225+
If a WebID is listed in that document, *and* it's of the specified class, it is
226+
given access.
221227

222-
#### All Agents (Public)
228+
Example ACL resource, `shared-file1.acl`, containing a group permission:
229+
230+
```ttl
231+
# Contents of https://alice.databox.me/docs/shared-file1.acl
232+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
233+
234+
# Individual authorization - Alice has Read/Write/Control access
235+
<#authorization1>
236+
a acl:Authorization;
237+
acl:accessTo <https://alice.example.com/docs/shared-file1>;
238+
acl:mode acl:Read, acl:Write, acl:Control;
239+
acl:agent <https://alice.example.com/profile/card#me>.
240+
241+
# Group authorization, giving Read/Write access to two groups, which are
242+
# specified in the 'work-groups' document.
243+
<#authorization2>
244+
a acl:Authorization;
245+
acl:accessTo <https://alice.example.com/docs/shared-file1>;
246+
acl:mode acl:Read, acl:Write;
247+
acl:agentClass <https://alice.example.com/work-groups#Accounting>;
248+
acl:agentClass <https://alice.example.com/work-groups#Management>.
249+
```
250+
251+
Corresponding `work-groups` Group Listing document:
252+
253+
```ttl
254+
# Contents of https://alice.example.com/work-groups
255+
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
256+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
257+
258+
<> a acl:GroupListing.
259+
260+
<#Employee> a rdfs:Class.
261+
<#Accounting> a rdfs:Class.
262+
<#Management> a rdfs:Class.
263+
264+
<https://bob.example.com/profile/card#me> a <#Employee>, <#Accounting>.
265+
<https://candice.example.com/profile/card#me> a <#Employee>, <#Accounting>.
266+
267+
<https://deb.example.com/profile/card#me> a <#Employee>, <#Management>.
268+
```
269+
270+
##### Securing Group Listings
271+
272+
Since Group Listing documents (which are linked to from ACL resources using
273+
the `acl:agentClass` predicate) are regular documents, care must be taken to
274+
secure them, by providing them with `.acl` resources of their own. For example,
275+
the `work-groups` document from the example above should have its own
276+
`work-groups.acl` resource, which restricts which users have Read/Write/etc
277+
access to it.
278+
279+
### Public Access (All Agents)
223280

224281
To specify that you're giving a particular mode of access to *everyone*
225282
(for example, that your WebID Profile is public-readable), you can use
@@ -237,6 +294,9 @@ of *all* agents (the general public). For example:
237294
acl:accessTo <https://alice.databox.me/profile/card>. # to the public profile
238295
```
239296

297+
Note that this is a special case of `acl:agentClass` usage, since it doesn't
298+
point to a Group Listing document that's meant to be de-referenced.
299+
240300
## Referring to Resources
241301

242302
The `acl:accessTo` predicate specifies *which resources* you're giving access

0 commit comments

Comments
 (0)