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

feat: Added bindings for CachedEnforcer #129

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

EmperorYP7
Copy link
Member

@EmperorYP7 EmperorYP7 commented Jul 27, 2021

Fixes #84 partially

Signed-off-by: Yash Pandey (YP) yash.btech.cs19@iiitranchi.ac.in


Description

This code:

  • Adds bindings for casbin::CachedEnforcer
    • The methods added are only the constructors and overrides
    • The rest of the methods are inherited from casbin::Enforcer just like the C++ implementation.
  • Adds versioning to pycasbin module through CMake configuration.
  • Refactors the workflow by passing the reference of the py::module object to functions.
    • Each function then defines a binding for all the methods present in the corresponding C++ translation unit.

Important Note

When I try to build the pycasbin target, it throws an error wherever there is an occurrence of casbin::Scope in the binding definition. Considering the fact that pycasbin is a client-centric interface, exposing casbin::Scope is redundant, so I dropped the support for Scope in pycasbin.

Signed-off-by: Yash Pandey (YP) <yash.btech.cs19@iiitranchi.ac.in>
Signed-off-by: Yash Pandey (YP) <yash.btech.cs19@iiitranchi.ac.in>
@hsluoyz hsluoyz requested a review from leeqvip July 30, 2021 13:45
@EmperorYP7 EmperorYP7 marked this pull request as ready for review July 30, 2021 13:52
@hsluoyz hsluoyz merged commit 6d8baae into casbin:master Jul 30, 2021
@github-actions
Copy link

🎉 This PR is included in version 1.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@EmperorYP7 EmperorYP7 deleted the cachedenforcer-binding branch August 7, 2021 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python bindings to facilitate PyCasbin-on-CPP
2 participants