Open faxal opened 4 years ago
The use case is to evaluate expressions from two different sources of truth. In the above example, role == 'Admin'
is known during expression evaluation, but age > 18 && age < 60
cannot be evaluated as source information is available elsewhere like an SQL database.
This allows user to further evaluate the expression elsewhere, burden is on the user to evaluate after that, not the library.
pls add this, this would make my life a lot easier
Please refer to https://github.com/casbin/casbin/issues/545 for details of the issue
Is that something can be implemented or is it possible as it stands today?
TLDR
When an expression cannot be evaluated, return the unevaluated expression as a result.
Given this expression:
role == 'Admin' && age > 18 && age < 60
Assuming
role == 'Admin'
istrue
butage > 18 && age < 60
cannot be evaluated, return result astrue && age > 18 && age < 60
or even better
age > 18 && age < 60