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: add synchronized version of methods into SyncedEnforcer #291

Merged
merged 4 commits into from
Sep 3, 2022

Conversation

damienmiheev
Copy link
Contributor

@damienmiheev damienmiheev commented Aug 29, 2022

Fix: #290

Functions added into SyncedEnforcer:

  • addPolicies(List<List> rules)
  • updatePolicy(List params1, List params2)
  • addPolicies(String[][] rules)
  • addNamedPolicies(String ptype, List<List> rules)
  • updateNamedPolicy(String ptype, List params1, List params2)
  • updateGroupingPolicy(List params1, List params2)
  • updateNamedGroupingPolicy(String ptype, List params1, List params2)
  • removePolicies(List<List> rules)
  • removePolicies(String[][] rules)
  • removeNamedPolicies(String ptype, List<List> rules)
  • addGroupingPolicies(List<List> rules)
  • addGroupingPolicies(String[][] rules)
  • addNamedGroupingPolicies(String ptype, List<List> rules)
  • addNamedGroupingPolicies(String ptype, String[][] rules)
  • removeGroupingPolicies(List<List> rules)
  • removeGroupingPolicies(String[][] rules)
  • removeNamedGroupingPolicies(String ptype, List<List> rules)
  • removeNamedGroupingPolicies(String ptype, String[][] rules)

Also added private methods to reduce number of thread-lock related duplication code.

@CLAassistant
Copy link

CLAassistant commented Aug 29, 2022

CLA assistant check
All committers have signed the CLA.

@casbin-bot
Copy link
Member

@tangyang9464 @imp2002 please review

@hsluoyz
Copy link
Member

hsluoyz commented Aug 29, 2022

@damienmiheev plz fix:

image

@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2022

Codecov Report

Merging #291 (ffedddc) into master (f5e38b6) will increase coverage by 1.55%.
The diff coverage is 62.13%.

@@            Coverage Diff             @@
##           master     #291      +/-   ##
==========================================
+ Coverage   67.95%   69.51%   +1.55%     
==========================================
  Files          47       47              
  Lines        2375     2168     -207     
  Branches      405      405              
==========================================
- Hits         1614     1507     -107     
+ Misses        647      547     -100     
  Partials      114      114              
Impacted Files Coverage Δ
...n/java/org/casbin/jcasbin/main/SyncedEnforcer.java 66.66% <62.13%> (+9.22%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hsluoyz
Copy link
Member

hsluoyz commented Aug 30, 2022

@tangyang9464 @seriouszyx @imp2002 plz review

Copy link
Member

@tangyang9464 tangyang9464 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsluoyz hsluoyz merged commit 0cf9d18 into casbin:master Sep 3, 2022
@github-actions
Copy link

github-actions bot commented Sep 3, 2022

🎉 This PR is included in version 1.28.0 🎉

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

savePolicies and removePolicies are not synchronised
6 participants