Closed DemianTinkiel closed 5 years ago
Hi @DemianTinkiel , model can be loaded in 3 ways: https://casbin.org/docs/en/model-storage. But Casbin doesn't provide a way to save it to somewhere. But It's very easy for you to write a util function to do that by accessing the Model
object.
The policy can be saved or loaded with adapters. I don't know what's policyURI
. But you need to implement an adapter to support your URI.
Hi @hsluoyz, thanks for that. But I was thinking more in the lines of Model and Policy providing a toString method for their content. The adapters could the build on top of that?
You can implement a toString()
method for model.
excellent. I'll do that + policy too
I think here will be another PR, right?
Yep. There will be one tomorrow morning.
BTW, you can link your Email in this commit with your GitHub account for more accurate contribution calculation.
@hsluoyz thanks, I'm just happy to help :smile: sorry for PR spam, merge conflict resolution in github is weird to me. #40 is ready when you are
@hsluoyz You closed the PR. Is that intentional? Do you want a new one?
Use case is that I have a program that takes a model and a policy path and to test it I'd like to be able to do something like