node-casbin/sequelize-adapter

removeFilteredNamedPolicy does not respect ptype

Closed this issue · 3 comments

I believe this is a bug. When calling removeFilteredNamedPolicy, sec or ptype values aren't respected.

Example

table content
id, ptype, v0, v1, v2, ...
1, p, user:1, table, read
2, p, user:1, desk, read
3, g, user:1, role:admin
4, p, user:2, desk, delete
enforcer.removeFilteredNamedPolicy('p', 0, 'user:1')

Expected Behaviour

To remove rows 1,2. i.e. policies that are applied to a user

Actual Behaviour

Removes rows 1,2 and 3. i.e. also removes grouping policies for user:1

working on this

🎉 This issue has been resolved in version 2.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀