[rt-users] RTIR

Scott Frisbie scottf at eacceleration.com
Sun Jan 15 18:46:53 EST 2006


Phanoko,
We addressed this issue (for RTFM) by creating a right 'SeeRTFM' and then 
modifying the Tab entry so it would only display if the person/group had that 
particular right. If you wanted, you could use an obscure right that already 
existed and use that as your test. 
Now for some details:
The path for all these files in under /opt/rt3/local so they don't get blown 
away on an upgrade.
Add the new right:
In local/lib/RT/System.pm there is an array of rights beginning with a line:
$RIGHTS = {
<snip>
}
Inside this section, you add your new right. I have 
SeeRTFM => "allow access to RTFM",            
Yours would be more like  " SeeRTIR => "allow access to RTIR",    "

If you need to restart apache to get the changes to show up, go ahead and do 
that. Under Configuration->Global-GroupRights, or  User Rights, you will see 
'SeeRTIR' show up in the  'New Rights' listing.

Now that the right has been granted, you need to make it useful.
Two files need to be edited here. I'll provide my code for RTFM, but as I 
don't have RTIR installed, you will need to find the corresponding files for 
RTIR.
In local/html/Callbacks/RTFM/Elements/Tabs/Default
I have this code:
#######
<%init>
if ($session{'CurrentUser'}->HasRight( Right => 'SeeRTFM',
                       Object => $RT::System )) {
    $toptabs->{'C'} = { title =>loc("RTFM"),
                                path  => "RTFM/index.html" };
}
</%init>
<%args>
$toptabs =>undef
</%args>
########
This only displays the Tab for RTFM in the left hand pane if the person has 
the right to see it.
And perhaps redundantly, I have  in 
local/html/Elements/Tabs
this code added to a series of 'if  ($session{'CurrentUser'}->HasRight' 
sections.
########
if ($session{'CurrentUser'}->HasRight( Right => 'SeeRTFM',
                       Object => $RT::System )) {

       $basetabs->{'C'} = { title =>loc("RTFM"),
                        path  => "RTFM/index.html" };
}
#####

You'll need to make your changes for RTIR to the appropriate files, but this 
method makes it so those groups that aren't supposed to have access to RTFM 
can't get there. If you decide that perhaps one person in a group DOES need 
to access it, that can be set under 'User Rights' for the individual.

There were a couple of different sections of our install of RT that we wanted 
to limit access to, so rather than use an obscure right, we created a few 
different 'SeeThis, SeeThat' kind of rights and used those to limit access.
HTH
Scott



On Thursday 12 January 2006 18:32, Phanoko wrote:
> Where can I set permissions so that only some users
> are able to see/access the RTIR module?
>
> Also within RTIR when I enter it I get
>  	too many arguments at
> /opt/rt3/lib/RT/Tickets_Overlay.pm line 1299
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com
>
> Download a free sample chapter of RT Essentials from O'Reilly Media at
> http://rtbook.bestpractical.com
>
> WE'RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
> San Francisco - Find out more at
> http://bestpractical.com/services/training.html

-- 
Scott Frisbie
IT Department
scottf at eAcceleration.com

"A democracy is a sheep and two wolves deciding on what to have for
lunch.  Freedom is a well armed sheep contesting the results of the
decision." - Benjamin Franklin




More information about the rt-users mailing list