I'm using Drools to perform security authorization checks at my application. I'm doing something like this:
global User currentUser
modify: PermissionCheck(target == person, action == "modify")
This works perfectly when nothing is null, but, for example, if the current user hasn't a Country assigned, it fails because of the nullity. I know I can workaround this with additional checks:
eval(currentUser.getCountry() != null)
But this becomes too verbose when there're three or more entities. Is there any other way to express this?