rdf-store-acl

0.1.4 • Public • Published

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

Package Sidebar

Install

npm i rdf-store-acl

Weekly Downloads

1

Version

0.1.4

License

MIT

Last publish

Collaborators

  • nicola