It selects all ruleEntities which has list of users and at least one of the users list contains the :userId param
In SQL terms
FROM rule_entity
WHERE :userId in (select user_id
from rule_entity_users
where rule_entity.rule_id=rule_entity_users.rule_id)