warn "Fixed $rows transactions with empty time values\n" if $rows > 0;
}
+ # One-time fix: We've created a "BulkUpdateTickets" access right; grant
+ # it to all auth'd users initially.
+ eval "use FS::upgrade_journal;";
+ my $upgrade = 'RT_add_BulkUpdateTickets_ACL';
+ if (!FS::upgrade_journal->is_done($upgrade)) {
+ my $groups = RT::Groups->new(RT->SystemUser);
+ $groups->LimitToEnabled;
+ $groups->LimitToSystemInternalGroups;
+ $groups->Limit(FIELD => 'Type', VALUE => 'Privileged', OPERATOR => '=');
+ my $group = $groups->First
+ or die "No RT internal group found for Privileged users";
+ my ($val, $msg) = $group->PrincipalObj->GrantRight(
+ Right => 'BulkUpdateTickets', Object => RT->System
+ );
+ die "Couldn't grant BulkUpdateTickets right to all users: $msg\n"
+ if !$val;
+ FS::upgrade_journal->set_done($upgrade);
+ }
+
return;
}
share/html/Elements/CalendarSlotSchedule
share/html/Ticket/Display.html
+# BulkUpdateTickets ACL
+lib/RT/System.pm
+share/html/Elements/Tabs
+share/html/Search/Bulk.html
+share/html/Ticket/Elements/Tabs
+
__PACKAGE__->AddRight( General => CreateSavedSearch => 'Allow creation of saved searches'); # loc
__PACKAGE__->AddRight( Admin => ExecuteCode => 'Allow writing Perl code in templates, scrips, etc'); # loc
+#freeside
+__PACKAGE__->AddRight( Staff => BulkUpdateTickets => 'Bulk update tickets');
+
=head2 AvailableRights
Returns a hashref of available rights for this object. The keys are the
}
if ( $has_query ) {
- $current_search_menu->child( bulk => title => loc('Bulk Update'), path => "/Search/Bulk.html$args" );
+ #freeside
+ if ( $session{'CurrentUser'}->HasRight( Right => 'BulkUpdateTickets', Object => RT->System ) ) {
+ $current_search_menu->child( bulk => title => loc('Bulk Update'), path => "/Search/Bulk.html$args" );
+ }
$current_search_menu->child( chart => title => loc('Chart'), path => "/Search/Chart.html$args" );
#formerly Callbacks/RTx-Calendar/Ticket/Element/Tabs/Default
}
my $title = loc("Update multiple tickets");
+#freeside
+unless ( $session{'CurrentUser'}
+ ->HasRight( Right => 'BulkUpdateTickets', Object => RT->System) )
+{
+ Abort('You are not allowed to bulk-update tickets.');
+}
+
# Iterate through the ARGS hash and remove anything with a null value.
map ( $ARGS{$_} =~ /^$/ && ( delete $ARGS{$_} ), keys %ARGS );
title => loc('Show Results'),
};
- $tabs->{"j"} = {
- path => "Search/Bulk.html$args",
- title => loc('Bulk Update'),
- };
+ #freeside
+ if ( $session{'CurrentUser'}
+ ->HasRight(Right => 'BulkUpdateTickets', Object => $RT::System) )
+ {
+ $tabs->{"j"} = {
+ path => "Search/Bulk.html$args",
+ title => loc('Bulk Update'),
+ };
+ }
$tabs->{"k"} = {
path => "Search/Chart.html$args",