mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 21:46:00 +00:00
13 lines
307 B
JavaScript
13 lines
307 B
JavaScript
const { compilePermissions, testPermission } = require('dbgate-tools');
|
|
|
|
let compiled = undefined;
|
|
|
|
function hasPermission(tested) {
|
|
if (compiled === undefined) {
|
|
compiled = compilePermissions(process.env.PERMISSIONS);
|
|
}
|
|
return testPermission(tested, compiled);
|
|
}
|
|
|
|
module.exports = hasPermission;
|