How to use the casbin.Helper.loadPolicyLine function in casbin

To help you get started, we’ve selected a few casbin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-casbin / sequelize-adapter / src / adapter.ts View on Github external
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);
    }
github notadd / notadd / apps / nest-upms / src / casbin / adapter.ts View on Github external
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);
        }
    }
    /**
github notadd / notadd / apps / nest-upms / src / casbin / adapter.ts View on Github external
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);
        }
    }
    /**

casbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Node.JS

Apache-2.0
Latest version published 2 days ago

Package Health Score

86 / 100
Full package analysis