rdf-store-acl
v0.1.4
Published
Add ACL support to your store
Downloads
5
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