Skip to content

Usage

To use Clearance roles and permissions in your app, simply map actions to the has-clearance policy you created earlier.

js
// config/policies.js
module.exports.policies = {
  'admin/*': 'has-clearance',
  'api/v1/*': 'has-clearance',
  'api/v1/posts/*': 'has-clearance'
}

TIP

Your user's role should be stored in the session as either req.session.userRole or req.session.user.role.

All open source projects are released under the MIT License.