-
-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RBAC deleteUser does not work correctly and is not tested #118
Comments
@hsluoyz what do you think? |
I'll create a pull request with RBAC tests and required changes. |
@hsluoyz Is the function properly tested in Golang? Since implementation looks the same, so issue should be the same. Unless the implementation of However, in golang tests it does not seem like user permission tests are correct. In line 107 I think alice should have no rights for data1 after she was deleted. |
Hi @Sefriol , I think you are right. Both Golang and Node.js Casbin have wrong implementation. Can you make a PR for Golang too to fix the code and test? |
I'll update the PR later on today. Golang does not seem to be that complicated either, but it has been awhile since I worked on Golang-project. |
…cies Previously it just removed Grouping policies. Now it shares same implementation as DeleteRole casbin/node-casbin#118
## [4.1.1](v4.1.0...v4.1.1) (2020-02-20) ### Bug Fixes * **enforcer.ts:** fix deleteUser and improve deleteRole description ([1e6af16](1e6af16)), closes [#118](#118)
🎉 This issue has been resolved in version 4.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Coveralls
Source
I think deleteUser should follow similar idea as deleteRole:
Since we want to remove assigned grouping policy and policies assigned to that user. Now when using
mongoose-adapter
, it will just remove user grouping policies, leaving normal policies still into the database. With code above, I was able to fix this.The text was updated successfully, but these errors were encountered: