Skip to content
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

[Bug] A matcher with multiple eval() doesn't work #315

Closed
JoshuaCWebDeveloper opened this issue Aug 16, 2021 · 3 comments · Fixed by #316
Closed

[Bug] A matcher with multiple eval() doesn't work #315

JoshuaCWebDeveloper opened this issue Aug 16, 2021 · 3 comments · Fixed by #316
Assignees
Labels
bug Something isn't working released

Comments

@JoshuaCWebDeveloper
Copy link
Contributor

A matcher with multiple eval() statements only calls the first eval(), caching the results.

This is likely the same issue as casbin/casbin#619, which was fixed in that repo, but apparently not in this one. There are also several people experiencing this issue here: http://disq.us/p/2g9ubnp (although they didn't say which language).

I'm experiencing this issue in node-casbin; however, I can also reproduce it in the online editor: https://casbin.org/casbin-editor/#6FGL6FCSV (not sure which language it uses). In this example, I would expect the result to be false:

  • The array is evaluated, and the first element picked is > 10
  • However, the second call to eval() should evaluate 10 > 18, however, it instead evaluates the first result again (the array) which is truthy.
@hsluoyz
Copy link
Member

hsluoyz commented Aug 16, 2021

@Zxilly @Gabriel-403

@hsluoyz hsluoyz self-assigned this Aug 16, 2021
@hsluoyz hsluoyz added the bug Something isn't working label Aug 16, 2021
@Zxilly
Copy link
Contributor

Zxilly commented Aug 16, 2021

working on this

Zxilly pushed a commit that referenced this issue Aug 17, 2021
github-actions bot pushed a commit that referenced this issue Aug 17, 2021
## [5.11.4](v5.11.3...v5.11.4) (2021-08-17)

### Bug Fixes

* **replaceeval:** add third param to replaceEval and only replace eval() w/ matching ruleName ([#316](#316)) ([bd4f5bf](bd4f5bf)), closes [#315](#315) [#315](#315)
@github-actions
Copy link

🎉 This issue has been resolved in version 5.11.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
3 participants