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

replace Box by Arc<RwLock> && add get_model, get_mut_model for Model.… #44

Merged

Conversation

0x8f701
Copy link
Member

@0x8f701 0x8f701 commented Jan 20, 2020

No description provided.

@0x8f701
Copy link
Member Author

0x8f701 commented Jan 20, 2020

If I understood correctly, we need to share the same role manager with all the assertions instead of just cloning to have their own role manager.

So I changed Box to Arc<RwLock> to achieve this.

BTW, since now model field of Model is private, it's impossible to implement external adapters, it breaks diesel-adapter. To solve this, I added get_model, get_mut_model, get_policy get_mut_policy functions

@0x8f701
Copy link
Member Author

0x8f701 commented Jan 20, 2020

@hsluoyz Could you review? Thx.

@codecov
Copy link

codecov bot commented Jan 20, 2020

Codecov Report

Merging #44 into master will decrease coverage by 0.73%.
The diff coverage is 55.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #44      +/-   ##
==========================================
- Coverage      87%   86.26%   -0.74%     
==========================================
  Files          12       12              
  Lines        1954     1966      +12     
==========================================
- Hits         1700     1696       -4     
- Misses        254      270      +16
Impacted Files Coverage Δ
src/rbac/default_role_manager.rs 90.78% <0%> (-1.78%) ⬇️
src/adapter/file_adapter.rs 47.91% <10%> (-2.09%) ⬇️
src/enforcer.rs 85.34% <100%> (-0.05%) ⬇️
src/rbac_api.rs 85.26% <100%> (ø) ⬆️
src/model.rs 93.55% <61.9%> (-1.39%) ⬇️
src/rbac/role_manager.rs 0% <0%> (-100%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcb9466...65d2ed7. Read the comment docs.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 21, 2020

lgtm

@hsluoyz hsluoyz merged commit af28e91 into casbin:master Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants