-
-
Notifications
You must be signed in to change notification settings - Fork 61
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: add StringAdapter for Enforcer to pass policy as string #204
Conversation
@EmperorYP7 @divy9881 @noob20000405 @sheny1xuan please review |
@cs1137195420 fix all errors: |
@hsluoyz I modified the code referring to the implementation of StringAdapter in golang. Is this PR OK now? |
@sheny1xuan plz review |
1279e0a
to
3133e17
Compare
@sheny1xuan I've modified the code, could you plz review it again? |
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!
@MaximAxelrodFirebolt plz review |
🎉 This PR is included in version 1.50.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
fix: #200
Description
I added
void LoadPolicy(std::string policy)
for Enforcer to pass policy to Adapter as a sting buffer, which could be called as the following code:Since c++ doesn't support overloaded functions with the same number and type of parameters, I didn't add a constructor like
Enforcer(const std::string& model_path, const std::string &policy)
in issue #200, that conflicts withEnforcer(const std::string& model_path, const std::string& policy_file)