0.1.1 • Published 5 years ago

@personaspace/server-acl v0.1.1

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

PersonaSpace Node.js Server ACL

CircleCI codecov Known Vulnerabilities JavaScript Style Guide

A package for checking resource ACLs on PersonaSpace servers.

PersonaSpace uses a powerful ACL implementation that give an owner unparalleled control over which visitors can interact with their data, where visitors can access their data from, and when visitors can access it. @personaspace/node-server-acl uses simple boolean values for access to the data and ACL middleware that can modify an ACL dynamically based on request data, date, time, etc...

This package provides only the resolution of the ACLs for a given visitor. The @personaspace/server-resource package handles validation of the visitor's access to the data. The @personaspace/server-acl-middleware contains the default ACL middleware.

Installation

Install @personaspace/server-acl using npm.

npm i @personaspace/server-acl

Usage

//  request is the web request on a PersonaSpace server.
const { resolveAcl } = require('@personaspace/server-acl')
const { middleware } = require('@personaspace/server-acl-middleware')

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')


resolveAcl(resourcePath, request, identity, acl, defaultAcl, groups, middleware, (err, resultantPerms) => {
  if(err) throw err
  //  Check resultantPerms
})

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:

Be sure to look at CONTRIBUTING.md.

License

PersonaSpace is licensed under the MIT License.