Grant admin access to an application running Brisk
- Plug & play
- Role assignement
Using npm:
npm install brisk-admin
Firstly, sessions need to be already activated in your applications, to allow admin login. Also your AWS credentials need to be loaded in the expected location:
req.site.config.api.aws
- Create an admin model that extends the plugin's model
var Parent = require("brisk-admin").getModel("admin");
var model = Parent.extend({
...
});
module.exports = model;
- Initiate the admin middleware in the express config at
/config/express.js
...
default: {
...
use: {
admin: false // the negative boolean will not execute the function or pass any setup options
...
}
...
}
- Extend your express & handlebars helpers with the
brisk-admin
helpers. For example:
var Main = require("brisk").getClass("main"),
Admin = require("brisk-admin").getHelper("handlebars"),
Parent = Main.inherit(Main, Admin);
Initiated by Makis Tracend
Distributed through Makesites
Released under the MIT license