[rt-devel] Feature for 2.0.15: The Configuration menu is only displayed if the user has rights.
Tony Aiuto
tony at ics.com
Thu Nov 21 10:36:41 EST 2002
>If you want the [Configuration]-Link be displayed only when the user has
>Configuration-Rights,
>Change the <%INIT> Section of webrt/Elements/Tabs to:
What a coincidence, you beat me to it by minutes. I was just about
to send my patch for the same feature. Mine (I believe) makes it easier
to control who sees the link.
I add a right to the ACL system (and correct a spelling error along the way)
*** lib/RT/ACE.pm 2002/10/30 15:17:18 1.1
--- lib/RT/ACE.pm 2002/10/30 15:20:25
***************
*** 75,85 ****
# System rights are rights granted to the whole system
%SYSTEMRIGHTS = (
SuperUser => 'Do anything and everything',
! AdminKeywords => 'Creatte, delete and modify keywords',
AdminGroups => 'Create, delete and modify groups',
AdminUsers => 'Create, Delete and Modify users',
ModifySelf => 'Modify one\'s own RT account',
!
);
# }}}
--- 75,85 ----
# System rights are rights granted to the whole system
%SYSTEMRIGHTS = (
SuperUser => 'Do anything and everything',
! AdminKeywords => 'Create, delete and modify keywords',
AdminGroups => 'Create, delete and modify groups',
AdminUsers => 'Create, Delete and Modify users',
ModifySelf => 'Modify one\'s own RT account',
! SeeConfiguration => 'See Configuration Tab',
);
# }}}
Then I key off of that right
*** WebRT/html/Elements/Tabs 2002/10/29 15:35:50 1.1
--- WebRT/html/Elements/Tabs 2002/11/21 15:28:58
***************
*** 98,115 ****
<%INIT>
my ($tab, $action);
! my $toptabs = { A => { title => 'Home',
! path => '',
! },
! B => { title => 'Search',
! path => 'Search/Listing.html'
! },
!
! D => { title => 'Configuration',
! path => 'Admin/'
! }
! };
!
my $topactions = {
A => { html => $m->scomp('/Elements/CreateTicket')
--- 98,115 ----
<%INIT>
my ($tab, $action);
! my $toptabs = { A => { title => 'Home',
! path => '',
! },
! B => { title => 'Search',
! path => 'Search/Listing.html'
! }
! };
! if ($session{'CurrentUser'}->HasSystemRight('SeeConfiguration')) {
! $toptabs->{'D'} = { title => 'Configuration',
! path => 'Admin/'
! };
! }
my $topactions = {
A => { html => $m->scomp('/Elements/CreateTicket')
Then I grant SeeConfiguration to the right groups or people.
-tony
More information about the Rt-devel
mailing list