UNPKG

@nangazaki/vue-rbac

Version:

Role-Based Access Control (RBAC) implementation for Vue.js

3 lines (2 loc) 421 B
function n(e,r,o=new Set,t=new Map){var i;if(t.has(e))return t.get(e);if(o.has(e))return[];const s=r[e];if(!s)throw new Error(`Role '${e}' not defined in rolesConfig.`);o.add(e);const f=new Set(s.permissions);for(const e of null!==(i=s.inherits)&&void 0!==i?i:[]){n(e,r,new Set(o),t).forEach((n=>f.add(n)))}const a=Array.from(f);return t.set(e,a),a}export{n as getAllPermissionsForRole}; //# sourceMappingURL=role.js.map