Skip to content

mettiu/sntry

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sntry

Sntry (/ˈsɛntɹɪ/) is a small ACL middlware for express that protects your routes.

Getting Started

Add Sntry in your package.json

npm install --save sntry

Instantiate it in yor code

// Require the module
const Sntry = require('sntry')

// Create or load some abilities (read more about Abilities later)
const abilities = {
  'admin': {
    'products': '*'
  },
  'guest': {
    'products': ['get']
  }
}

const sntry = new Sntry(abilities)

// Tell Sntry the current user role
sntry.setUserRole('guest')

// Use the express middleware to check the route
app.use(sntry.check)

// It will chekck the current visited route against the abilities
// of the current user.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%