When calling HasRight multiple times in the same scope,
@{$args{EquivOjects}} is modified (push). This result in
large (an wrong) queries.
I don’t have time to submit a tested patch, but the fix should
be easy. Multiple lines like the following are the offenders:
push( @{ $args{‘EquivObjects’} }, $args{Object} );
-Todd