I've got a question if I'm somehow able to make this code working like this:
If it matches the first predicate: (it.controller == controllerName && it.actions.contains(actionName))
, it finds only those, which match this predicate and it doesn't find from those underneath.
If it doesn't find anything from first predicate, then it goes to second one and finds all which match second predicate, but don't match the third one.
ArrayList rule = rules.findAll {
(it.controller == controllerName && it.actions.contains(actionName))
||
(it.controller == controllerName && it.actions.contains("*"))
||
(it.controller == "*" && it.actions.contains("*"))
}