[rt-users] View dashboard of another user who's searches depend on __CurrentUser__

Sally Ainsley sally.ainsley at lifecycle-software.com
Thu Jan 21 08:43:43 EST 2016


Hi Woody

Not sure what your overall goal is however I have put our staff into GROUPS based on the teams they are in.  

We then have searches that are for _CurrentUser_ as well as other searches that are based on OWNERGROUP = xxxxx.  

We then have saved searches visible to each GROUP so that they can see tickets assigned to their team - this means that if a member of staff if off others in that team can pick up the work.  Works well when team managers are away also.

Not sure if this helps 

Sally

Sally Ainsley 

-----Original Message-----
From: rt-users [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Woody - Wild Thing Safaris
Sent: 21 January 2016 12:48
To: rt-users at lists.bestpractical.com
Subject: [rt-users] View dashboard of another user who's searches depend on __CurrentUser__

Hi all,

I have a dashboard, in which there are searches that depend on __CurrentUser__, so each user that accesses the dashboard can only see tickets owned by them.

If someone is away, i would like someone else to be able to see the dashboard of the absent person. I don't want to give them the absent user's login, nor do i want to create searches for each user that are hardwired to their username.

Something like www.myrt.com/dashboards/12345/Dashname/Username would do the job whereby __CurrentUser__ is replaced by "Username" and not the person who's actually logged in.

I can see in lib/RT/Tickets.pm in sub _parser the line

         # replace __CurrentUser__ with id
         $value = $self->CurrentUser->id if $value eq '__CurrentUser__';

and in lib/RT/Search/Simple.pm

sub HandleOwner     {
     if (!$_[2] and $_[1] eq "me") {
         return owner => "Owner.id = '__CurrentUser__'";
     }
     elsif (!$_[2] and $_[1] =~ /\w+@\w+/) {
         return owner => "Owner.EmailAddress = '$_[1]'";
     } else {
         return owner => "Owner = '$_[1]'";
     }
}

So i think that a hack is needed somewhere there, and when the url is parsed the extra username field assigned to a variable that can be used in those subs. I can't find however where sub HandleOwner is called from since that's the only time it appears in the code!

Does this sound like a sensible way of going about it, or can anyone think of a better solution, or know of an existing one?

thanks in advance

Woody.

-- 

-----------------------

Richard Wood (Woody)
Managing Director
Wild Thing Safaris Ltd.

UK: 2B Habbo St, Greenwich, London
Dar es Salaam: 5 Ethan St, Mbezi beach
Arusha: 3 Ebeneezer Rd, Njiro
PO BOX 34514 DSM
Office: +255 (0) 222 617 166
Office Mobile: +255 (0) 773 503 502
Direct: +255 742 373 327
Skype: woody1tz
http://wildthingsafaris.com





More information about the rt-users mailing list