case -> if when doing class membership and nil checking 

This resolves a problem with rules like this:

    has_permission_on :projects, :to => [:update] do
      if_permitted_to :update, :groups
    end

where project.groups evaluates to an array