mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-26 09:50:47 +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);
|