wildduck/lib/roles.js
2018-08-28 14:37:06 +03:00

13 lines
280 B
JavaScript

'use strict';
const config = require('wild-config');
const AccessControl = require('accesscontrol');
const ac = new AccessControl();
ac.setGrants(config.api.roles);
config.on('reload', () => {
ac.setGrants(config.api.roles);
});
module.exports.can = role => ac.can(role);