@personaspace/server-acl-middleware-ondomain
v0.1.2
Published
PersonaSpace Node.js server ACL middleware that prevents/allows access based on the host requesting data.
Downloads
8
Maintainers
Readme
PersonaSpace onDomain ACL Middleware
For Node.js server
Node.js server ACL middleware that prevents/allows access based on the host requesting data.
Installation
Install @personaspace/server-acl-middleware-ondomain
using npm.
npm i @personaspace/server-acl-middleware-ondomain
Usage
// "request" is the web request on a PersonaSpace server.
import { resolveAcl } from "@personaspace/server-acl";
import { onDomain } from "@personaspace/server-acl-middleware-ondomain";
const resource = "./ebntly/data/notes/test";
const identity = "https://ebntly.personaspace.com";
const defaultAcl = require("../support/default-acl.json");
const acl = require(`${resource}.json`)["@acl"];
const groups = require("../support/groups.json");
const middleware = [onDomain];
resolveAcl({
acl,
defaultAcl,
groups,
identity,
resourcePath,
request
}, middleware, (err, resultantPerms) => {
if(err) throw err;
// Check resultantPerms
});
Documentation
Documentation is located at https://personaspace.github.io/node-server-acl-middleware-ondomain. For issues with the documentation, please Create a new issue.
Contributing to PersonaSpace
PersonaSpace is a large project and contributors are welcome. Thank you for your support and efforts!
There are a lot of ways to contribute:
- Create a new issue to report bugs or request features
- Fix an issue
Be sure to look at CONTRIBUTING.md.
License
PersonaSpace is licensed under the MIT License.