township-access

2.0.0 • Public • Published

township-access

An access control module to accompany township-auth.

Install

npm i --save township-access

Example

var townshipAccess = require('township-access')
var level = require('level')
 
var db = level('db')
var access = townshipAccess(db)
var key = 'pizza'
var scopes = ['site:read', 'site:edit']
 
access.create(key, scopes, function (err, account) {
  access.verify(key, ['site:edit'], function (err, verified) {
    console.log(verified)
  })
})

See also

License

MIT

Package Sidebar

Install

npm i township-access

Weekly Downloads

5

Version

2.0.0

License

MIT

Last publish

Collaborators

  • jhand
  • maxogden
  • sethvincent