solid / web-access-control-spec

Web Access Control (WAC)
https://solid.github.io/web-access-control-spec/
MIT License
120 stars 25 forks source link

Access Mode Extensions #85

Open csarven opened 3 years ago

csarven commented 3 years ago

The ACL ontology ( http://www.w3.org/ns/auth/acl ) defines acl:Read, acl:Write, acl:Append, and acl:Control access modes.

This is a general issue, a study, to document common operations and new access modes (based on use cases).

csarven commented 3 years ago

Documentation of operations and access modes from discussions.

csarven commented 2 years ago

The WIP table here can be used to get a deeper understanding of operations and access modes. Operations may be determined by the nature of an HTTP request but they are not strictly limited to HTTP requests.

For the time being, the table uses CRUD terms for simplicity and the purpose of this discussion - do not bother to nitpick on this. Happy to switch to use a different variation, RFC terms, or introduce 50 very specific terms. WAC ED loosely uses CRUD terms for common operations but it is not fixed to that.

I'm not sure what to do with this table yet / where to put it but we can figure something out alongside https://github.com/solid/specification/issues/14#issuecomment-683480525 (even if it just serves to catch bugs or our assumptions).

Request Operation Access Modes Level
GET /C/R Read acl:Read Resource
HEAD /C/R Read acl:Read Resource
OPTIONS /C/R Read acl:Read Resource
POST /C/ Create + Update acl:Append [1] Resource, Content
PUT /C/R + If-None-Match Create, Read acl:Write, acl:Read [2] Resource
PATCH /C/R + If-None-Match + INSERT Create, Read acl:Write, acl:Read [2] Resource, Content
POST /C/R Update acl:Append (or acl:Write) Content
PUT /C/R Create?, Update acl:Write [2][3] Resource
PATCH /C/R + INSERT Create?, Update acl:Write [2][3] Resource?, Content
PATCH /C/R + DELETE + INSERT Create?, Read, Update acl:Write, acl:Read [2][3] Resource?, Content [4]
PATCH /C/R + DELETE Update, Read acl:Write, acl:Read Content
DELETE /C/ Delete acl:Write, acl:Read Resource
DELETE /C/R Delete acl:Write [5] Resource

[1] POST /C/ is to "perform resource-specific processing on the request payload" (RFC 7231). The semantics in Solid Protocol: server-assigned name for resource to be created as member of container, and to update containment statements. So, Create operation of /C/R and an Update operation on /C/.

[2] Requires Append (or Write) on /C/ and Write on /C/R to Create.

[3] Requires Write on /C/R to Update.

[4] PATCH /C/R + DELETE + INSERT could be interpreted as a specific content-level update (or modify) operation where DELETE s1p1o1 and INSERT s1p1o2 - I don't know what the practice/terminology is out there for this. We can come back to this later.

[5] Requires Write on /C/ and /C/R.

bblfish commented 2 years ago

Very helpful. Just a reminder that there is simple easy to understand argument to remove the Control Mode, with more logical/mathematical arguments to support that in Specification issue #303.

Also, it should be possible to model your table using mathematical work on Lenses, to get at precisely why the different modes exist, and how they interact with the HTTP methods.