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

Filtered policies support for casbin redis adapter #29

Closed
sujatapatnaik52 opened this issue Aug 9, 2022 · 6 comments · Fixed by #31
Closed

Filtered policies support for casbin redis adapter #29

sujatapatnaik52 opened this issue Aug 9, 2022 · 6 comments · Fixed by #31

Comments

@sujatapatnaik52
Copy link

sujatapatnaik52 commented Aug 9, 2022

Hi,

I am using the rbac_with_deny_model for my usecase with casbin's redis adapter - https://github.com/casbin/redis-adapter. I have the following questions:

  1. When the records are added via the casbin enforcer, does it store them all in memory as well?
  2. If the answer to number 1 is yes, then I read about performace and at some point the policies might grow which will cause the the enforce() calls to take more time. I can add another instance of casbin to handle this but I was looking to use policy subset loading feature. Apparently this does not exist for redis-adapter yet. Is there a way to add it or should I use only those backend storage libraries that support this?

Thank you.

@casbin-bot
Copy link
Member

@tangyang9464 @JalinWang

@hsluoyz hsluoyz transferred this issue from casbin/casbin Aug 9, 2022
@casbin-bot
Copy link
Member

@hsluoyz hsluoyz removed the question label Aug 9, 2022
@hsluoyz
Copy link
Member

hsluoyz commented Aug 9, 2022

@JalinWang plz implement FilteredAdapter interface

/cc @tangyang9464

@casbin-bot
Copy link
Member

@sujatapatnaik52
Copy link
Author

sujatapatnaik52 commented Aug 9, 2022

Hi, can you also answer the question about the policies being stored in-memory? and now that you will add filtered policy loading option for redis, do I have to create a new enforcer with filtered policies every time I want to check the permissions?

@JalinWang
Copy link
Member

@sujatapatnaik52 Hi~ Thanks for concerning about Casbin.

  1. When the records are added via the casbin enforcer, does it store them all in memory as well?

For this question, the answer is true.

Apparently this does not exist for redis-adapter yet.

I'll make a PR to support filtering in days.

do I have to create a new enforcer with filtered policies every time I want to check the permissions?

No, you don't. You can divide enforcers by domains or use watcher to keep them synced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants