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

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@lists.bestpractical.com] On Behalf Of Woody - Wild Thing Safaris
Sent: 21 January 2016 12:48
To: rt-users@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

HI Sally,

Thanks for your input.

My overall goal is to make it easy for another team member to take over
another’s work while they are away. Since each person is using the same
dashboard all based on CurrentUser, only someone logged in as user X
can see user X’s tickets.

Your idea of using OwnerGroup has given me an idea of a possible
solution - I create an identical dashboard but based on OwnerGroup and
not CurrentUser where OwnerGroup = “holiday” and if someone is away,
I add them to the group holiday, in which case their tickets will be
visible in that dashboard.

Where it’s going to fail though is with the LastUpdated != “CurrentUser
I can’t replace that CurrentUser with OwnerGroup. It would need to
be 'privileged ’ or LastUpdated = ‘Requestor’ or something, or i
list all the users of the queue in a long LastUpdated != “fred” AND
Lastupdated !=“jane” etc.

thanks for the inspiration and if you have any ideas about the
LastUpdated - that would be great!

w.On 21/01/16 16:43, Sally Ainsley wrote:

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@lists.bestpractical.com] On Behalf Of Woody - Wild Thing Safaris
Sent: 21 January 2016 12:48
To:rt-users@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 likewww.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

Hi,

Another option would be “LastUpdatedByGroup” in a similar fashion to
OwnerGroup - though it looks like OwnerGroup is for Roles, and
LastUpdatedBy isn’t a Role i don’t think.

w.On 25/01/16 20:29, Woody - Wild Thing Safaris wrote:

HI Sally,

Thanks for your input.

My overall goal is to make it easy for another team member to take
over another’s work while they are away. Since each person is using
the same dashboard all based on CurrentUser, only someone logged
in as user X can see user X’s tickets.

Your idea of using OwnerGroup has given me an idea of a possible
solution - I create an identical dashboard but based on OwnerGroup
and not CurrentUser where OwnerGroup = “holiday” and if someone is
away, I add them to the group holiday, in which case their tickets
will be visible in that dashboard.

Where it’s going to fail though is with the LastUpdated !=
CurrentUser
I can’t replace that CurrentUser with OwnerGroup. It would need to
be 'privileged ’ or LastUpdated = ‘Requestor’ or something, or
i list all the users of the queue in a long LastUpdated != “fred” AND
Lastupdated !=“jane” etc.

thanks for the inspiration and if you have any ideas about the
LastUpdated - that would be great!

w.

On 21/01/16 16:43, Sally Ainsley wrote:

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@lists.bestpractical.com] On
Behalf Of Woody - Wild Thing Safaris
Sent: 21 January 2016 12:48
To:rt-users@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 likewww.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