[Rt-commit] r9539 - rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements

ruz at bestpractical.com ruz at bestpractical.com
Fri Nov 2 15:56:47 EDT 2007


Author: ruz
Date: Fri Nov  2 15:56:46 2007
New Revision: 9539

Modified:
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
   rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents

Log:
* fine tune showing of Steal/Take actions according to rights

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/QueueTabs	Fri Nov  2 15:56:46 2007
@@ -246,12 +246,12 @@
             $actions->{'D'} = {
                 path  => "RTIR/Display.html?Action=Take&id=$id",
                 title => loc('Take')
-            };
+            } if $can{'ModifyTicket'} || $Ticket->CurrentUserHasRight('TakeTicket');
         } elsif ( $Ticket->Owner != $session{CurrentUser}->id ) {
             $actions->{'E'} = {
                 path  => "RTIR/Display.html?Action=Steal&id=$id",
                 title => loc('Steal')
-            };
+            } if $can{'ModifyTicket'} || $Ticket->CurrentUserHasRight('StealTicket');
         }
     }
 

Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents	(original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Elements/ShowIncidents	Fri Nov  2 15:56:46 2007
@@ -45,7 +45,7 @@
 %   unless ( $action ) {
 <b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Incident/LinkToIncident.html?id=<% $Ticket->Id %>">[Link]</a></b>
 <b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Child=<% $Ticket->Id %>&Queue=Incidents">[New]</a></b>
-%   } else {
+%   } elsif ( $action ne 'No' ) {
 <a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?Action=<% $action %>&id=<% $Ticket->Id %>">[<% loc( $action ) %>]</a>
 %   }
 % }
@@ -60,10 +60,17 @@
 
 my $action = '';
 if ( $Ticket->Owner != $session{'CurrentUser'}->Id ) {
-    if ( $Ticket->Owner == $RT::Nobody->Id ) {
-        $action = 'Take';
+    unless ( $Ticket->CurrentUserHasRight('OwnTicket') ) {
+        $action = 'No';
+    }
+    elsif ( $Ticket->Owner == $RT::Nobody->Id ) {
+        $action = 'Take'
+            if $Ticket->CurrentUserHasRight('ModifyTicket')
+            || $Ticket->CurrentUserHasRight('TakeTicket');
     } else {
-        $action = 'Steal';
+        $action = 'Steal'
+            if $Ticket->CurrentUserHasRight('ModifyTicket')
+            || $Ticket->CurrentUserHasRight('StealTicket');
     }
 }
 


More information about the Rt-commit mailing list