Open fdorantesm opened 5 years ago
Hi, i've used this mongoose adapter to handle rules in mongodb, I can't delete roles, what i'm doing wrong?
static async getInstance() { const adapter = await Adapter.newAdapter(db.uri, db.config); const model = `${process.env.STORAGE_PATH}/casbin/rbac.conf`; return casbin.newEnforcer(model, adapter); }
Assign roles works properly.
static async assignRole(identifier, role, domain = '*') { const enforcer = await Enforcer.getInstance(); return enforcer.addRoleForUser(identifier, role, domain); }
deleteRoleForUser returns false
static async revokeRole(identifier, role, domain = 'admin') { const enforcer = await Enforcer.getInstance(); console.log(identifier, role, domain); return enforcer.deleteRoleForUser(identifier, role); }
deleteRolesForUser returns false
static async revokeRoles(identifier) { const enforcer = await Enforcer.getInstance(); return enforcer.deleteRolesForUser(identifier); }
@fdorantesm This repo seems to be dead. Use this instead: https://github.com/node-casbin/mongoose-adapter
Hi, i've used this mongoose adapter to handle rules in mongodb, I can't delete roles, what i'm doing wrong?
Assign roles works properly.
deleteRoleForUser returns false
deleteRolesForUser returns false