0.1.4 • Published 9 years ago

rdf-store-acl v0.1.4

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

rdf-store-acl

Add ACL support to your store. It follows the RDF-ext Interface specification.

Install

npm install --save rdf-store-acl

Usage

The object constructor is the following:

new AclStore(store, [options, accessControl])

The accessControl is by default, is set to be a solid-acl object, however, you can pass a different ACL lib.

The options are passed to the ACL object, for this, see solid-acl or any other ACL implementations you are using

Example

var rdf = require('rdf-ext')
var LdpStore = require('rdf-store-ldp')
var FileStore = require('rdf-store-fs')
var ServerStore = require('rdf-store-server')
var AclStore = require('rdf-store-acl')

var server = new ServerStore({
  local: new AclStore(new LdpStore(rdf)),
  remote: new AclStore(new FileStore(rdf))
})

// ...

var options = {agent: userWebID, application: requestOrigin, host: host}
store
  .graph('http://localhost:8080, function (graph, err) {
    // This will run on the local store (FileStore)
    // err is an Error object if the user can't access
  }, options)

store(host)
  .graph('http://other.tld/resource.tld', function (graph, err) {
    // This will run on the remote store (LdpStore)
    // ACL will use LDPStore to figure out permissions
  }, options)

History

Originally made by Nicola Greco

Licence

MIT

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago