-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix: *matcher result should be boolean or number* for KeyGet2 #347
Conversation
Pull Request Test Coverage Report for Build 1833860796
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1919832746
💛 - Coveralls |
@Gabriel-403 @Zxilly @kingiw @nodece please review |
|
eda6069
to
e69b014
Compare
@tomfriedhof can you please review and suggest changes if required. |
@Shivansh-yadav13 , when I was debugging it the value of 'result' was undefined. In our implementation, we have multiple instances of Casbin enforcer. Steps to reproduce:
The issue does not occur if step 1 has some permissions model:
An example of 'exp' from the policy_defintion |
This is what happening const enforcer1 = await newEnforcer('examples/test_model.conf');
await enforcer1.enforce('sub', 'dom', '/data1', 'read', { office: 'london', floor: 'first' });
const enforcer2 = await newEnforcer('examples/test_model.conf', 'examples/test_policy.csv');
await enforcer2.enforce('sub', 'dom', '/data1', 'read', { office: 'london', floor: 'first' }); Error --> const enforcer1 = await newEnforcer('examples/test_model.conf', 'examples/test_policy.csv');
await enforcer1.enforce('sub', 'dom', '/data1', 'read', { office: 'london', floor: 'first' });
const enforcer2 = await newEnforcer('examples/test_model.conf');
await enforcer2.enforce('sub', 'dom', '/data1', 'read', { office: 'london', floor: 'first' }); No Error const enforcer1 = await newEnforcer('examples/test_model.conf');
await enforcer1.enforce('sub', 'dom', '/data1', 'read', { office: 'london', floor: 'first' });
const enforcer2 = await newEnforcer('examples/test_model.conf');
await enforcer2.enforce('sub', 'dom', '/data1', 'read', { office: 'london', floor: 'first' }); No Error |
@grzegorz-kap Ig the error you are facing is resolved after #348, can you please confirm. |
Could you add unit tests to cover this case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
## [5.13.2](v5.13.1...v5.13.2) (2022-03-02) ### Bug Fixes * *matcher result should be boolean or number* for KeyGet2 ([#347](#347)) ([0257078](0257078))
🎉 This PR is included in version 5.13.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
* fix: *matcher result should be boolean or number* for KeyGet2 (#347) * fix: *matcher result should be boolean or number* for KeyGet2 * fix: updated error hint * fix: basic keyGet2 test * fix: basic_keyget2_policy.csv (cherry picked from commit 0257078) Signed-off-by: Zxilly <zhouxinyu1001@gmail.com> * feat(rbac): add `getUsersForRoleInDomain` & `getRolesForUserInDomain` (#351) Documentation indicates that there is existance of `getUsersForRoleInDomain` and `getRolesForUserInDomain` api, but it does not yet exists. This commit implements these functions, by aliasing them to existing rbac function that had already cater for domain apis, to increase and improve dev experience. re #304 (cherry picked from commit 4896ca2) * feat: #357 Support keyMatch5 (#359) (cherry picked from commit e6a6d8a) * test: use new utils Signed-off-by: Zxilly <zhouxinyu1001@gmail.com> Co-authored-by: Shivansh Yadav <yadavshivansh@gmail.com> Co-authored-by: Chen Wen Kang <23054115+cwkang1998@users.noreply.github.com> Co-authored-by: ZCDC_Ren <kuanglong0312@sina.com>
Fix: #332