Getting Group memberships

Hello,

We have an RT instance where we’ve added some other “views” to the
index page so that our users can view how many tickets exist that have
been “taken” but don’t belong to them and things like that.

We now have different groups using RT I want to create the query for
those “views” so that we display only the tickets that belong to the
groups the user that’s currently logged in is a member of. To explain
it a bit, we have one of those boxes that display the “Newest 20
tickets owned by someone else” but at the moment since some tickets
are created in other queues which I am not a member of, the query is
not correct:

— start snippet —

<&|/Elements/TitleBox,
title => loc("[_1] newest tickets owned by someone else", $rows),
title_href => “Search/Results.html”.$QueryString &>
<& /Elements/TicketList,
Format => “’<a
href=”$RT::WebPath/Ticket/Display.html?id=id">id/TITLE:#’,
’<a href="$RT::WebPath/Ticket/Display.html?id=id">Subject/TITLE:Subject’,
QueueName, ExtendedStatus, CreatedRelative, OwnerName, '<A
HREF="$RT::WebPath/Ticket/Display.html?Action=Steal&id=id">".loc(‘Steal’)."/TITLE: '
",
Query => $Query,
OrderBy => ‘Created’,
Order => ‘DESC’,
ShowNavigation => 0,
Rows => $rows
&>
</&>
<%init>
my $rows = 10;

my $Query = “Owner != ‘Nobody’ AND Owner !=
’”.$session{‘CurrentUser’}->Id."’ AND ( Status = ‘new’ OR Status =
‘open’ OR Status = ‘stalled’ )";

— end snippet —

I would like to add to this something that would restrict the count to
the queues that the Group the user is a member of has right over. We
assign the privileges to the Groups rather than the individuals, makes
it easier to administer when you have 80+ users.

Any suggestions?

Cheers

/B

Bruno Mattarollo bruno.mattarollo@gmail.com
Currently in: Sydney, Australia

Just replying to myself to see if someone had an idea … the logic
would be something like:

Fetch Group Memberships from current user
Get queues over which these Groups have “SeeQueue” rights
Count the Tickets on those Queues only

So the question is:

  1. How do I get the Groups from which the current user is a member of?

I am not an expert in RT so sorry about asking this … might easy to
reply for some of the experts in the list … :slight_smile:

Cheers

/BOn 9/8/05, Bruno Mattarollo bruno.mattarollo@gmail.com wrote:

Hello,

We have an RT instance where we’ve added some other “views” to the
index page so that our users can view how many tickets exist that have
been “taken” but don’t belong to them and things like that.

We now have different groups using RT I want to create the query for
those “views” so that we display only the tickets that belong to the
groups the user that’s currently logged in is a member of. To explain
it a bit, we have one of those boxes that display the “Newest 20
tickets owned by someone else” but at the moment since some tickets
are created in other queues which I am not a member of, the query is
not correct:

— start snippet —

<&|/Elements/TitleBox,
title => loc("[_1] newest tickets owned by someone else", $rows),
title_href => “Search/Results.html”.$QueryString &>
<& /Elements/TicketList,
Format => “’<a
href=”$RT::WebPath/Ticket/Display.html?id=id">id/TITLE:#’,
’<a href="$RT::WebPath/Ticket/Display.html?id=id">Subject/TITLE:Subject’,
QueueName, ExtendedStatus, CreatedRelative, OwnerName, '<A
HREF="$RT::WebPath/Ticket/Display.html?Action=Steal&id=id">".loc(‘Steal’)."/TITLE: '
",
Query => $Query,
OrderBy => ‘Created’,
Order => ‘DESC’,
ShowNavigation => 0,
Rows => $rows
&>
</&>
<%init>
my $rows = 10;

my $Query = “Owner != ‘Nobody’ AND Owner !=
’”.$session{‘CurrentUser’}->Id."’ AND ( Status = ‘new’ OR Status =
‘open’ OR Status = ‘stalled’ )";

— end snippet —

I would like to add to this something that would restrict the count to
the queues that the Group the user is a member of has right over. We
assign the privileges to the Groups rather than the individuals, makes
it easier to administer when you have 80+ users.

Any suggestions?

Cheers

/B


Bruno Mattarollo bruno.mattarollo@gmail.com
Currently in: Sydney, Australia

Bruno Mattarollo bruno.mattarollo@gmail.com
Currently in: Sydney, Australia