[rt-users] Re: Getting Group memberships

Bruno Mattarollo bruno.mattarollo at gmail.com
Wed Sep 14 20:26:02 EDT 2005


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 ... :)

Cheers

/B

On 9/8/05, Bruno Mattarollo <bruno.mattarollo at 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__</a>/TITLE:#',
> '<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject',
> QueueName, ExtendedStatus, CreatedRelative, OwnerName, '<A
> HREF=\"$RT::WebPath/Ticket/Display.html?Action=Steal&id=__id__\">".loc('Steal')."</a>/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 at gmail.com>
> Currently in: Sydney, Australia
> 


-- 
Bruno Mattarollo <bruno.mattarollo at gmail.com>
Currently in: Sydney, Australia



More information about the rt-users mailing list