Limiting the information unprivileged users are able to see via the webinterface

Hello,

is there a way in RT 4.x to reduce the information an unprivileged user can see when he’s accessing
his tickets via the RT webinterface?

The only information I want the user to see are the replies concerning his tickets and no other
information like the change of owner, addition or removal of AdminCC user, etc.

I couldn’t find an appropriate setting or right to reduce the output.

Best regards,

Lars

Lars Braeuer wrote:

Hello,

is there a way in RT 4.x to reduce the information an unprivileged user can see when he’s accessing
his tickets via the RT webinterface?

Yes, use Callbacks to skip the transactions you don’t want.
The Callback you want to add is:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction
with SkipTransaction having something like:
<%init>
my $myskip=0;

if ( $Transaction->Type =~ /^(Set|Told)$/ ) {
if ( $Transaction->Field =~ /^(TimeWorked|Told|Starts|Started|Due)$/ ) {
$myskip = 1;
}
else {
$myskip = 0;
}
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

Which skips the TimeWorked,Told,Starts,Started,Due transactions.
You might want to consider modifying other files in SelfService to not
show the user who worked on it but to show for example ‘helpdesk’.

Greetings,

Joop

is there a way in RT 4.x to reduce the information an unprivileged
user can see when he’s accessing
his tickets via the RT webinterface?

Yes, use Callbacks to skip the transactions you don’t want.
The Callback you want to add is:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction

Note that this callback also applies to the normal ticket history
display, not just self service. To affect just self service, you should
put something like this as the first <%init> line:

return if $session{‘CurrentUser’}->Privileged;

Thomas

Hello Joop,

thanks a lot for this hint. This really saved my day. :slight_smile:

Actually, I finally achieved what I wanted to do with the following (in case someone else is looking
for this):

<%init>
return if $session{‘CurrentUser’}->Privileged;
my $myskip=1;

if ( $Transaction->Type =~ /^(Correspond|Create)$/ ) {
$myskip = 0;
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

This skips everything but Correspond and the initial Create message.

Also thanks to Thomas about the “return” hint.

Best regards,

LarsAm 28.09.2011 17:08, schrieb Joop:

Lars Braeuer wrote:

Hello,

is there a way in RT 4.x to reduce the information an unprivileged user can see when he’s accessing
his tickets via the RT webinterface?

Yes, use Callbacks to skip the transactions you don’t want.
The Callback you want to add is:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction
with SkipTransaction having something like:
<%init>
my $myskip=0;

if ( $Transaction->Type =~ /^(Set|Told)$/ ) {
if ( $Transaction->Field =~ /^(TimeWorked|Told|Starts|Started|Due)$/ ) {
$myskip = 1;
}
else {
$myskip = 0;
}
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>
Which skips the TimeWorked,Told,Starts,Started,Due transactions.
You might want to consider modifying other files in SelfService to not show the user who worked on
it but to show for example ‘helpdesk’.

Greetings,

Joop


RT Training Sessions (http://bestpractical.com/services/training.html)

  • Chicago, IL, USA September 26 & 27, 2011
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

I am looking to do exactly this, where the user can only see the initial create and correspond. Where did you place the code, and where did you call it from?
RT4.0.2 on Ubuntu ServerFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Lars Braeuer
Sent: Thursday, September 29, 2011 12:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limiting the information unprivileged users are ableto see via the webinterface

Hello Joop,

thanks a lot for this hint. This really saved my day. :slight_smile:

Actually, I finally achieved what I wanted to do with the following (in case someone else is looking
for this):

<%init>
return if $session{‘CurrentUser’}->Privileged;
my $myskip=1;

if ( $Transaction->Type =~ /^(Correspond|Create)$/ ) {
$myskip = 0;
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

This skips everything but Correspond and the initial Create message.

Also thanks to Thomas about the “return” hint.

Best regards,

Lars

I want to implement this exact setting for unprivileged users. We do not have any special callbacks, and therefore don’t have a directory structure like:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction (we’re using RT4.0.2, but the /opt/rt4/local/html directory is completely empty)

My question again is where would I put the SkipTransaction code from below, and from where, and I guess how, would I call it? I’m not familiar with implementing Callbacks, so any help would be greatly appreciated.

Thanks,
Izz-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Lars Braeuer
Sent: Thursday, September 29, 2011 12:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limiting the information unprivileged users are ableto see via the webinterface

Hello Joop,

thanks a lot for this hint. This really saved my day. :slight_smile:

Actually, I finally achieved what I wanted to do with the following (in case someone else is looking
for this):

<%init>
return if $session{‘CurrentUser’}->Privileged;
my $myskip=1;

if ( $Transaction->Type =~ /^(Correspond|Create)$/ ) {
$myskip = 0;
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

This skips everything but Correspond and the initial Create message.

Also thanks to Thomas about the “return” hint.

Best regards,

Lars

Izz Abdullah wrote:

I want to implement this exact setting for unprivileged users. We do not have any special callbacks, and therefore don’t have a directory structure like:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction (we’re using RT4.0.2, but the /opt/rt4/local/html directory is completely empty)

Create the directories needed and put the file in. Stop your webserver,
clean your mason cache and restart your webserver and the transactions
should be gone.

My question again is where would I put the SkipTransaction code from below, and from where, and I guess how, would I call it? I’m not familiar with implementing Callbacks, so any help would be greatly appreciated.

Callbacks are called from RT code, you don’t have to add the callback
hooks, only the code must be there to be executed

There is also an extension that does something like it through personal
prefs and a system wide default you can supress transactions.
RT-Extension-HistoryFilter

Regards,

Joop

Ok…so I did my research and found where callbacks are placed, and how. So now I have this SkipTransaction callback, and it removes everything except for the initial Create, Correspondence, and Comments. I have it as coded below – /^(Correspond|Create)$/
But it would seem comments are inclusive within correspondence in the api? I don’t want unprivileged users to see comments. Any pointers?-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Izz Abdullah
Sent: Tuesday, October 04, 2011 8:59 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Limit Ticket History View to Correspondence and Createonly

I want to implement this exact setting for unprivileged users. We do not have any special callbacks, and therefore don’t have a directory structure like:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction (we’re using RT4.0.2, but the /opt/rt4/local/html directory is completely empty)

My question again is where would I put the SkipTransaction code from below, and from where, and I guess how, would I call it? I’m not familiar with implementing Callbacks, so any help would be greatly appreciated.

Thanks,
Izz

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Lars Braeuer
Sent: Thursday, September 29, 2011 12:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limiting the information unprivileged users are ableto see via the webinterface

Hello Joop,

thanks a lot for this hint. This really saved my day. :slight_smile:

Actually, I finally achieved what I wanted to do with the following (in case someone else is looking
for this):

<%init>
return if $session{‘CurrentUser’}->Privileged;
my $myskip=1;

if ( $Transaction->Type =~ /^(Correspond|Create)$/ ) {
$myskip = 0;
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

This skips everything but Correspond and the initial Create message.

Also thanks to Thomas about the “return” hint.

Best regards,

Lars

RT Training Sessions (http://bestpractical.com/services/training.html)

  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011

Ok…so actually I have noticed this callback is not working at all.
I have placed the code Lars has below in a file called SkipTransaction (the callback used in ShowHistory) in /opt/rt4/local/html/Callbacks/hibbett/Ticket/Elements/ShowHistory
I’ve changed the owner using chown -R root:www-data on the Callbacks directory
I’ve deleted / cleared the mason cache

This callback is not seeming to work for me. I would definitely appreciate some help here.

Thanks in advance,
Izz-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Izz Abdullah
Sent: Wednesday, October 05, 2011 2:18 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limit Ticket History View to Correspondence andCreateonly

Ok…so I did my research and found where callbacks are placed, and how. So now I have this SkipTransaction callback, and it removes everything except for the initial Create, Correspondence, and Comments. I have it as coded below – /^(Correspond|Create)$/
But it would seem comments are inclusive within correspondence in the api? I don’t want unprivileged users to see comments. Any pointers?

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Izz Abdullah
Sent: Tuesday, October 04, 2011 8:59 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Limit Ticket History View to Correspondence and Createonly

I want to implement this exact setting for unprivileged users. We do not have any special callbacks, and therefore don’t have a directory structure like:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction (we’re using RT4.0.2, but the /opt/rt4/local/html directory is completely empty)

My question again is where would I put the SkipTransaction code from below, and from where, and I guess how, would I call it? I’m not familiar with implementing Callbacks, so any help would be greatly appreciated.

Thanks,
Izz

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Lars Braeuer
Sent: Thursday, September 29, 2011 12:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limiting the information unprivileged users are ableto see via the webinterface

Hello Joop,

thanks a lot for this hint. This really saved my day. :slight_smile:

Actually, I finally achieved what I wanted to do with the following (in case someone else is looking
for this):

<%init>
return if $session{‘CurrentUser’}->Privileged;
my $myskip=1;

if ( $Transaction->Type =~ /^(Correspond|Create)$/ ) {
$myskip = 0;
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

This skips everything but Correspond and the initial Create message.

Also thanks to Thomas about the “return” hint.

Best regards,

Lars

RT Training Sessions (http://bestpractical.com/services/training.html)

  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011
    RT Training Sessions (http://bestpractical.com/services/training.html)
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Barcelona, Spain November 28 & 29, 2011

Now it suddenly seems to work…I removed some spacing, maybe it was the paste across from windows to ssh…nonetheless, after I removed the spacing I was getting a nice little perl error so I had to explicitly define the $myskip variable:
my($myskip)=1;-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Izz Abdullah
Sent: Wednesday, October 05, 2011 3:08 PM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] First Callback is not working at all

Ok…so actually I have noticed this callback is not working at all.
I have placed the code Lars has below in a file called SkipTransaction (the callback used in ShowHistory) in /opt/rt4/local/html/Callbacks/hibbett/Ticket/Elements/ShowHistory
I’ve changed the owner using chown -R root:www-data on the Callbacks directory
I’ve deleted / cleared the mason cache

This callback is not seeming to work for me. I would definitely appreciate some help here.

Thanks in advance,
Izz

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Izz Abdullah
Sent: Wednesday, October 05, 2011 2:18 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limit Ticket History View to Correspondence andCreateonly

Ok…so I did my research and found where callbacks are placed, and how. So now I have this SkipTransaction callback, and it removes everything except for the initial Create, Correspondence, and Comments. I have it as coded below – /^(Correspond|Create)$/
But it would seem comments are inclusive within correspondence in the api? I don’t want unprivileged users to see comments. Any pointers?

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Izz Abdullah
Sent: Tuesday, October 04, 2011 8:59 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Limit Ticket History View to Correspondence and Createonly

I want to implement this exact setting for unprivileged users. We do not have any special callbacks, and therefore don’t have a directory structure like:
/opt/rt3/local/html/Callbacks/mococo/Ticket/Elements/ShowHistory/SkipTransaction (we’re using RT4.0.2, but the /opt/rt4/local/html directory is completely empty)

My question again is where would I put the SkipTransaction code from below, and from where, and I guess how, would I call it? I’m not familiar with implementing Callbacks, so any help would be greatly appreciated.

Thanks,
Izz

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Lars Braeuer
Sent: Thursday, September 29, 2011 12:47 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Limiting the information unprivileged users are ableto see via the webinterface

Hello Joop,

thanks a lot for this hint. This really saved my day. :slight_smile:

Actually, I finally achieved what I wanted to do with the following (in case someone else is looking
for this):

<%init>
return if $session{‘CurrentUser’}->Privileged;
my $myskip=1;

if ( $Transaction->Type =~ /^(Correspond|Create)$/ ) {
$myskip = 0;
}
$$skip=$myskip;

</%init>

<%args>
$Transaction => undef
$skip
</%args>

This skips everything but Correspond and the initial Create message.

Also thanks to Thomas about the “return” hint.

Best regards,

Lars

RT Training Sessions (http://bestpractical.com/services/training.html)

  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Melbourne VIC, Australia November 28 & 29, 2011
  • Barcelona, Spain November 28 & 29, 2011
    RT Training Sessions (http://bestpractical.com/services/training.html)
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Barcelona, Spain November 28 & 29, 2011
    RT Training Sessions (http://bestpractical.com/services/training.html)
  • San Francisco, CA, USA October 18 & 19, 2011
  • Washington DC, USA October 31 & November 1, 2011
  • Barcelona, Spain November 28 & 29, 2011