Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: corrected prefixes

...

  1. I want to allow a user with username "smith123" to have read, write access to resource http://localhost:8080/rest/webacl_box1.

    Using these two "files" to create our Authorization and ACL resources.

    Code Block
    titleAcl.txt
    @prefix webac: <http://www.w3.org/ns/auth/acl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix ldp: <http://www.w3.org/ns/ldp#> .
    <> a ldp:BasicContainer ;
       rdf:type ???:WebAcl .
    
    
    Code Block
    titleAuthorization.txt
    @prefix webacacl: <http://www.w3.org/ns/auth/acl#> .
    @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    @prefix ldp: <http://www.w3.org/ns/ldp#> .
    <> a ldp:RDFSource ;
       rdf:type webac:Authorization ;
       webacacl:agent "smith123" ;
       webacacl:mode acl:Read, acl:Write ;
       webacacl:accessTo <http://localhost:8080/rest/webacl_box1> .

    We would execute the following commands.

    Code Block
    > curl -X POST -H "Content-type: text/turtle" --data-binary "@Acl.txt" "http://localhost:8080/rest"
    
    http://localhost:8080/rest/new/node/acl
    
    > curl -X POST -H "Content-type: text/turtle" --data-binary "@Authorization.txt" "http://localhost:8080/rest"
    
    http://localhost:8080/rest/new/node/authorization
    
    > echo "PREFIX ldp: <http://www.w3.org/ns/ldp#>
    INSERT INTO {
    <> ldp:contains <http://localhost:8080/rest/new/node/authorization> .
    }" | curl -X PATCH -H "Content-type: application/sparql-update" --upload-file - "http://localhost:8080/rest/new/node/acl"
    
    > echo "PREFIX webacacl: <http://www.w3.org/ns/auth/acl#>
    INSERT INTO {
    <> webacacl:accessControl <http://localhost:8080/rest/new/node/acl> .
    }" | curl -X PATCH -H "Content-type: application/sparql-update" --upload-file - "http://localhost:8080/rest/webacl_box1"
  2. I wants this group to have write access on this collection
    ....