-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
ParseException when pass a RequestValue
to Enforce
method
#302
Comments
Could you please provide the version you used? |
casbin version: 2.0.0-preview.4 |
Yes, in I confess it may be confusing due to some early designs. The code above returns the type Thank you for telling us and we'll optimize it in the next release. The current code has removed the constructor with parameters of |
@sagilio I noticed that the constructor of |
Ok, Thanks for your help. By the way, if i really want to pass an array of object as a request, is there a best practice?
But in 2.00-preview.4, this method is disappeared, if i still use this code, it will call this unexpected |
I'm afraid not. I did not take part in the development of |
The reason for the remove |
Fixed by: #303 |
I need to pass request attribute as a dynamic length array, so I'm trying to use a list of string to construct a RequestValue, and pass it as the second parameter of this method.
public bool Enforce<TRequest>(EnforceContext context, TRequest requestValues) where TRequest : IRequestValues;
and it throws a
ParseException
with reason: No property or field 'Value1' exists in type 'RequestValues' (at index 14)And if i use
Request<string,string,string>
, this case runs ok.stack backtrace:
Full code here:
test_policy.csv:
Did I do something wrong?
The text was updated successfully, but these errors were encountered: