fastify-rbac
RBAC (Role-based access control) plugin for Fastify.
This plugin uses fast-rbac under the hood.
ToC
Fastify support
- v1.x.x - supports
>= fastify-1.0.0
Installation
npm i fastify-rbac --save
Back to top
Features and requirements
- Wildcard rules support
- Inheritance support
- Typescript support
- Requires fastify
>=1.0.0
. - Node.js
>=8.9.0
.
Back to top
Usage
Add it to your project like regular fastify plugin. Use register
method and pass options to it.
const fastify = require('fastify');
const app = fastify();
const rbacPlugin = require('fastify-rbac');
app.register(rbacPlugin, { });
It exposes rbac
to fastify instance fastify.rbac
which you may use to check/add/remove roles and permissions.
Back to top
Plugin options
See RBAC Options.
Docs
See plugin docs.
Also refer to RBAC docs.
Back to top
Changelog
See changelog.
Back to top
See also
Back to top
License
Licensed under MIT.
Back to top