Hide Option for Tabs

Hi,
i want to hide certain options available in Tools Tab based on
User Group, for example Group A user should have that option
displayed, while Group B user should not find that option.
HideConfiguration doc works for only Configuration tab but i need for
other tabs, child tabs.

Thanks in Advance,
P. Prasanna

This is my first attempt at answering a post on this list, so bear with me…

Here’s an idea for a solution. In $RTHOME/local/html/Elements/Tabs you
can put if clauses based on methods for the $session object. I don’t
know which methods are available but I suppose you could find one that
says “IsMember( GroupA)”. Here’s an example of working code just to
get you moving.

if ( $session{‘CurrentUser’}->HasRight( Right => ‘AdminUsers’, Object
=> RT->System ) )
{
$tools->child( reports => title => loc(‘Reports’), path =>
‘/Reports/Activity/’,description => loc(‘Activity Report’) );
}

Haïm.2012/2/13 Pattabi Prasanna escort146@gmail.com:

Hi,
i want to hide certain options available in Tools Tab based on
User Group, for example Group A user should have that option
displayed, while Group B user should not find that option.
HideConfiguration doc works for only Configuration tab but i need for
other tabs, child tabs.

Thanks in Advance,
P. Prasanna

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

  • Boston March 5 & 6, 2012

This is my first attempt at answering a post on this list, so bear with me…

Here’s an idea for a solution. In $RTHOME/local/html/Elements/Tabs you
can put if clauses based on methods for the $session object. I don’t

Please don’t override html/Elements/Tabs, it’s a large file and
every time you upgrade you’ll need to merge your changes.

Use the Privileged or Unprivileged callbacks that we provide.

There are examples of how to do this cleanly on
http://requesttracker.wikia.com/wiki/Menus

For Pattabi’s workflow, you’ll want $group->HasMemberRecursively to
check if someone is in a group.

It often makes sense to optimize this code to check the membership and
then cache some information in the user’s session. We’ve profiled a
number of RT instances for clients where lots of extra group checks
caused page slowdowns until we added some caching in.

-kevin