casbin icon indicating copy to clipboard operation
casbin copied to clipboard

[Question]Can casbin support clear policy by domain?

Open lynnzhang89 opened this issue 2 years ago • 3 comments

Want to prioritize this issue? Try:

issuehunt-to-marktext


What's your scenario? What do you want to achieve? In my scenario, i have lots of domain. Each domain has lots of policy. After i made a modification on a policy under a domain, i've to load all policy under all domain to update casbin. So, is there any possible to support clear specify domain and load specify domain.

lynnzhang89 avatar Jul 06 '22 08:07 lynnzhang89

@tangyang9464 @closetool @sagilio

casbin-bot avatar Jul 06 '22 08:07 casbin-bot

How do you modify the policies? If you modify through Casbin's APIs, there is no need to reload.

JalinWang avatar Jul 06 '22 10:07 JalinWang

@lynnzhang89 can you use delete filtered policy API?

hsluoyz avatar Jul 06 '22 11:07 hsluoyz

@lynnzhang89 use: https://casbin.io/docs/management-api#removefilteredpolicy , set domain as filter

hsluoyz avatar Nov 21 '22 14:11 hsluoyz