-
Notifications
You must be signed in to change notification settings - Fork 1
Permission handling does not take into account if a resource already exists or not #13
Comments
Using a root ACL like this for testing: @prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
<#container> a acl:Authorization ;
acl:agentClass foaf:Agent ;
acl:accessTo </>;
acl:mode
acl:Read,
acl:Write,
acl:Control.
<#resource> a acl:Authorization ;
acl:agentClass foaf:Agent ;
acl:default </>;
acl:mode
acl:Read,
acl:Write,
acl:Control. curl -v -X PUT -H 'Content-Type: text/turtle' -T root-acl.ttl http://localhost:3000/.acl |
And then seeing if a request like this succeeds or not:
|
The current code assumes there is only one ACL to look at, and it determines that based on the URI of the request (PermissionBasedAuthorizer, PathBasedReader). This code is really hard to spelonk, but adding some debug statements to find out what calls what. |
|
There is also src/authorization/permissions/SparqlPatchModesExtractor which says an append-only PATCH requires only append on the resource (this only true if the resource already exists) and a PATCH that needs write requires write, append, create, and/or(?) delete on the resource. src/authorization/permissions/Permissions.ts defines read, append, write, create, delete. I think a better model would be read/add/remove, and:
And then:
|
To do: adapt the unit tests there. |
Second draft of what this could look like: |
Implementing Editor’s Draft, 2021-09-11 of Web Access Control
Continuation of https://github.com/solid/community-server/issues/618 where we concluded:
The text was updated successfully, but these errors were encountered: