[Bps-public-commit] r9541 - RT-Extension-TicketLocking/lib/RT/Extension

ruz at bestpractical.com ruz at bestpractical.com
Fri Nov 2 16:15:34 EDT 2007


Author: ruz
Date: Fri Nov  2 16:15:34 2007
New Revision: 9541

Modified:
   RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm

Log:
* check ACLs on hard locking

Modified: RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm
==============================================================================
--- RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm	(original)
+++ RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm	Fri Nov  2 16:15:34 2007
@@ -218,6 +218,9 @@
 package RT::Ticket;
 
 our @LockTypes = qw(Auto Take Hard);
+our %CheckRightOnLock = (
+    Hard => 'ModifyTicket',
+);
 
 sub LockPriority {
     my $self = shift;
@@ -258,6 +261,11 @@
         my $current_type = $lock->Content->{'Type'};
         return undef if $ticket->LockPriority( $type ) <= $ticket->LockPriority( $current_type );
     }
+
+    if ( my $right = $CheckRightOnLock{ $type } ) {
+        return undef unless $ticket->CurrentUserHasRight('ModifyTicket');
+    }
+
     $ticket->Unlock($type);    #Remove any existing locks (because this one has greater priority)
     my $id = $ticket->id;
     my $username = $ticket->CurrentUser->Name;



More information about the Bps-public-commit mailing list