corm-can-koa
This is a simple module for generating koa-compatible middleware to add access control to particular routes using a user model loaded at this.user
with the can()
method attached. See corm-can for details on how to attach the can()
method.
Usage
Once your user model is mounted and has the can()
method available, you can simply do this;
const can = // Make an app with some sort of chainable router that populates this.params.const app = app // Load the user into this.user somehowapp app