Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private loadPolicyLine(line: CasbinRule, model: Model) {
const result = line.ptype + ', ' + [line.v0, line.v1, line.v2, line.v3, line.v4, line.v5].filter(n => n).join(', ');
Helper.loadPolicyLine(result, model);
}
private _loadPolicyLine(val: IPermission | IRole, model: Model) {
if (isPermission(val)) {
const result = `p,` + [val.name, val.addon, val.addon, val.action].filter(n => n).join(', ');
Helper.loadPolicyLine(result, model);
} else {
const result = `g, ${val.name},${val.permission}`;
Helper.loadPolicyLine(result, model);
}
}
/**
private _loadPolicyLine(val: IPermission | IRole, model: Model) {
if (isPermission(val)) {
const result = `p,` + [val.name, val.addon, val.addon, val.action].filter(n => n).join(', ');
Helper.loadPolicyLine(result, model);
} else {
const result = `g, ${val.name},${val.permission}`;
Helper.loadPolicyLine(result, model);
}
}
/**