Manage access authorization scopes
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
LICENSE.md
README.md
index.js
package.json

README.md

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