npm.io
1.2.5 • Published 6 years ago

nestjs-casbin-mongodb

Licence
MIT
Version
1.2.5
Deps
3
Size
1.6 MB
Vulns
1
Weekly
0
Stars
26

NestJs Casbin Mongodb

NestJS module for Casbin using the MongoDB Adapter

NPM Version License Code Size Top Language Top Language

Installation

$ yarn install nestjs-casbin-mongodb

Setup module

import { Module } from '@nestjs/common';
import { NestCasbinModule } from 'nestjs-casbin-mongodb';
import { join } from 'path';

@Module({
  imports: [
    NestCasbinModule.forRoot({
      uri: 'mongo://localhost:27017',
      casbinModelPath: join(__dirname, './rbac_model.conf'),
      collectionName: 'roles',
      databaseName: 'my-db-name',
    }),
  ],
  controllers: [],
  providers: [],
})
export class AppModule {}

License

This project is MIT licensed.