JSPM

rdf-store-acl

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q35461F
  • License MIT

Add ACL support to your store

Package Exports

  • rdf-store-acl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rdf-store-acl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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