[rt-users] How to hide the Configuration Tab in RT3

bill at daze.net bill at daze.net
Thu Apr 3 03:40:27 EST 2003


Odhiambo Washington was kind enough to forward to me a message he received
from Greg Dickerson back in April 2002 on this very subject (for RT2).
The condition to check rights in RT2 didn't work with RT3, so it took a
bit of research and trial and error, but I finally got it to work.


How to hide the Configuration Tab in RT3

First copy "/path/to/rt3/share/html/Elements/Tabs" to
"/path/to/rt3/local/html/Elements/Tabs" then open it in your editor and
remove the following code block:


my $basetabs = {     A => { title => loc('Homepage'),
                           path => '',
                         },
                    B => { title => loc('Tickets'),
                        path => 'Search/Listing.html'
                      },
                    E => { title => loc('Configuration'),
                           path => 'Admin/'
                         },
                    K => { title => loc('Preferences'),
                        path => 'User/Prefs.html'
                      },
                    P => { title => loc('Approval'),
                           path => 'Approvals/'
                         },
                 };



...and in it's place add:


my $basetabs;

if ( $session{'CurrentUser'}->HasRight(Right => 'SuperUser',
                              Object => $RT::System) ) {

  $basetabs = {     A => { title => loc('Homepage'),
                           path => '',
                         },
                    B => { title => loc('Tickets'),
                        path => 'Search/Listing.html'
                      },
                    E => { title => loc('Configuration'),
                          path => 'Admin/'
                         },
                    K => { title => loc('Preferences'),
                        path => 'User/Prefs.html'
                      },
                    P => { title => loc('Approval'),
                           path => 'Approvals/'
                         },
                 };
} else {
  $basetabs = {     A => { title => loc('Homepage'),
                           path => '',
                         },
                    B => { title => loc('Tickets'),
                        path => 'Search/Listing.html'
                      },
                    K => { title => loc('Preferences'),
                        path => 'User/Prefs.html'
                      },
                    P => { title => loc('Approval'),
                           path => 'Approvals/'
                         },
                 };
}



Once this is working you can just assign your "admin" users the global
right of "SuperUser" and they will see the config link.  Regular users
will not.

Enjoy!

Regards,
Bill Gerrard
Daze Networks, Inc.




More information about the rt-users mailing list