keycloak-demo/utils/acl.js
2021-09-01 21:15:26 +08:00

11 lines
219 B
JavaScript

const ALLOW_GROUPS = new Set(['/professorx'])
const mod = {}
module.exports = mod
mod.checkAllow = groups => {
if (!Array.isArray(groups)) return false
return groups.filter(t => ALLOW_GROUPS.has(t)).length > 0
}