[rt-users] Hide "Bulk Update" from menu

Daniel Schwager Daniel.Schwager at dtnet.de
Sun Dec 27 05:50:33 EST 2015


Hi Matt,

thanks for your help. 

        z-rt4app-a:/opt/site/rt4/local/html/Callbacks/mbi/Elements/Tabs/Privileged
                <%init>
                # Now, let's remove the 'Bulk Update' if we are not member of a defined group
                if ( $Path =~ m/Search/ ) {
                   my $in_group = 'FuntionBulkUpdate';
                   my $group = RT::Group->new( $session{CurrentUser} );
                   $group->LoadUserDefinedGroup( $in_group );
                   if (!$group->HasMemberRecursively( $session{CurrentUser} -> id )) {
                        # Remove the "Reply" link from the actions...
                        $RT::Logger->debug("Remove BulkUpdate menu");
                        PageMenu->delete('bulk');
                   }
                }
                </%init>

                <%args>
                $Path
                </%args>

> -----Original Message-----
> From: Matt Zagrabelny [mailto:mzagrabe at d.umn.edu]
> Sent: Tuesday, December 22, 2015 5:28 PM
> To: Daniel Schwager
> Cc: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Hide "Bulk Update" from menu
> 
> Hi Daniel,
> 
> On Tue, Dec 22, 2015 at 10:18 AM, Daniel Schwager
> <Daniel.Schwager at dtnet.de> wrote:
> > Hi everybody,
> >
> > is there a possibility to hide the "Bulk Update" menu from every privileged user who is not member
> of a "Bulk-Update"-Group?
> 
> Maybe.
> 
> 
> > I cannot find a corresponding Callback in share/html/Elements/Tabs
> > nor ./share/html/Search/Results.html to change the menu hiding "Bulk Update".
> 
> We remove the "Reply" action from the menu. The callback file is:
> 
> /Elements/Tabs/Privileged
> 
> Here is the contents:
> 
> <%init>
> # Now (and only to the Privileged) remove the default Reply link.
> # We add a "Reply" link (with status=open) via the life cycle.
> if (
>     $Path =~ m{/Ticket/}
>     &&
>     $DECODED_ARGS->{id}
>     &&
>     $DECODED_ARGS->{id} =~ /^\d+$/
> ) {
>     my $Ticket = RT::Ticket->new($session{CurrentUser});
>     $Ticket->Load($DECODED_ARGS->{id});
>     if (
>         $Ticket
>         &&
>         $Ticket->Status eq 'new'
>     ) {
>         # Remove the "Reply" link from the actions...
>         if (my $actions = PageMenu->child('actions')) {
>             $actions->delete('reply');
>         }
>     }
> }
> </%init>
> <%args>
> $Path
> </%args>
> 
> You should be able to tweak other parts of the tabs. Using some of the
> code above as a guide.
> 
> Cheers,
> 
> -m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2279 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20151227/734f7b15/attachment.bin>


More information about the rt-users mailing list