0.0.3 • Published 5 months ago

casbin-authorization v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
5 months ago

casbin-authorization

LoopBack

Installation

Install CasbinAuthorizationComponent using npm;

$ [npm install | yarn add] casbin-authorization

Basic Use

Configure and load CasbinAuthorizationComponent in the application constructor as shown below.

import {CasbinAuthorizationComponent, CasbinAuthorizationComponentOptions, DEFAULT_CASBIN_AUTHORIZATION_OPTIONS} from 'casbin-authorization';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
  constructor(options: ApplicationConfig = {}) {
    const opts: CasbinAuthorizationComponentOptions = DEFAULT_CASBIN_AUTHORIZATION_OPTIONS;
    this.configure(CasbinAuthorizationComponentBindings.COMPONENT).to(opts);
      // Put the configuration options here
    });
    this.component(CasbinAuthorizationComponent);
    // ...
  }
  // ...
}
0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago