mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-11-10 17:47:07 +08:00
13 lines
280 B
JavaScript
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);
|