Skip to content

Commit

Permalink
Limit lookup type for custom roles in reports
Browse files Browse the repository at this point in the history
Previously custom roles were only for tickets, but not any more since we
added assets support.
  • Loading branch information
sunnavy committed Dec 5, 2023
1 parent 3e69b74 commit fcad7f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/RT/Report.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ our %GROUPINGS_META = (
return () unless $queues;

my $crs = RT::CustomRoles->new( $self->CurrentUser );
$crs->LimitToLookupType( $self->RecordClass->CustomFieldLookupType );
# Adding this to avoid returning all records when no queues are available.
$crs->LimitToObjectId(0);

for my $id ( keys %$queues ) {
my $queue = RT::Queue->new( $self->CurrentUser );
$queue->Load($id);
Expand Down

0 comments on commit fcad7f0

Please sign in to comment.