Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

township/township-access

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

township-access

An access control module to accompany township-auth.

Install

npm i --save township-access

Example

const townshipAccess = require('township-access')
const level = require('level')

const db = level('db')
const access = townshipAccess(db)
const key = 'pizza'
const scopes = ['site:read', 'site:edit']

access.create(key, scopes, function (err, account) {
  access.verify(key, ['site:edit'], function (err, verified) {
    console.log(verified)
  })
})

Documentation

See also

License

MIT

About

Manage access authorization scopes

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published