node-casbin / sequelize-adapter

Sequelize adapter for Casbin
https://github.com/casbin/node-casbin
Apache License 2.0
64 stars 34 forks source link

removeFilteredNamedPolicy does not respect ptype #45

Closed iamhosseindhv closed 3 years ago

iamhosseindhv commented 3 years ago

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

hsluoyz commented 3 years ago

@Zxilly @Gabriel-403

Gabriel-403 commented 3 years ago

working on this

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 2.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: