township-access
v2.0.0
Published
An access control module to accompany township-auth
Downloads
21
Readme
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
- township-auth - manage authentication credentials
- township-token - create & decode JWT tokens with township auth/access data