Closed robin-83 closed 1 year ago
@sagilio @sociometry @AsakusaRinne
You are right, we need a more stable parser. Here is a similer issue about this https://github.com/casbin/Casbin.NET/issues/264.
@robin-83 fixed by: https://github.com/casbin/Casbin.NET/pull/317
I have tried to escape or wrap commas like described here: https://casbin.org/docs/policy-storage But this does not work for Casbin.NET, instead I get an exception: System.ArgumentException: "Invalid policy size: expected 3, got 4." If I got that right then Casbin.NET calls a simple
string.Split
which is not aware of wrapped instances of the string parts or escaped characters. I would suggest using a csv package like Csv Helper to ensure that the parts are read correctly. My test case:With this model
and policy:
p, alice@example.com, "Basic,Test", Get
If I remove the comma and the quotes, everything works as expected.