Hide "Bulk Update" from menu

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?

I cannot find a corresponding Callback in share/html/Elements/Tabs
nor ./share/html/Search/Results.html to change the menu hiding “Bulk Update”.

Thanks for any hint helping me to implement this small feature.

Best regards
Danny

smime.p7s (2.23 KB)

Hi Daniel,

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

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>

smime.p7s (2.23 KB)

Hi Matt,

thanks for your help. In the previous E-Mail (the enter-key was faster than me!) you found my implementation of hiding the “Bulk Update” menu dependent of the membership.

Best regards
Danny

smime.p7s (2.23 KB)