franciscogouveia / hapi-rbac

RBAC (Rule Based Access Control) for hapijs
ISC License
105 stars 20 forks source link
hapi nodejs rbac xacml

hapi-rbac

npm version Build Status Coverage Status Dependency Status

A Rule Based Access Control module for hapi.

This is inspired by the XACML policies.

Versions

How to use it

First, install

npm install --save hapi-rbac

Then, import the module in your hapi server instance.

async () => {
    try {
      await server.register({
        plugin: require('hapi-rbac'),
        options: {
          // rbac-option See API reference
        }
      });
    } catch(er) {
      // ...
    }
}

Then, configure your policies. Check the API Reference.

Learn more about Rule Based Access Control

To have a better idea of how this works, you can check my Bachelor's project presentation about XACML here (english), or here (portuguese).

Even though this plugin doesn't implement the XACML specification, it was based on its policies.