fastify-rbac
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    fastify-rbac

    NPM Version Downloads Count Vunerabilities Count Build Status License Codecov

    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, { /* rbac options */ });

    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

    Install

    npm i fastify-rbac

    DownloadsWeekly Downloads

    6

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    8.95 kB

    Total Files

    6

    Last publish

    Collaborators

    • m03geek