[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-203-gdf4eb51

Shawn Moore sartak at bestpractical.com
Fri Jul 23 19:48:54 EDT 2010


The branch, new-style-templates has been updated
       via  df4eb51c359a146256de69fe2ea6713640c5e160 (commit)
      from  fee0d1f08adcf01dd390c5c80cd927d94e706c79 (commit)

Summary of changes:
 lib/RT/Queue_Overlay.pm    |    1 +
 lib/RT/Template_Overlay.pm |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit df4eb51c359a146256de69fe2ea6713640c5e160
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Jul 23 19:48:24 2010 -0400

    Begin adding a FullTemplates queue right

diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 98bdec5..b2df91b 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -94,6 +94,7 @@ our $RIGHTS = {
     AssignCustomFields  => 'Assign and remove custom fields',         # loc_pair
     ModifyTemplate      => 'Modify Scrip templates for this queue',   # loc_pair
     ShowTemplate        => 'Display Scrip templates for this queue',  # loc_pair
+    FullTemplates       => 'Modify templates with unlimited code execution', # loc_pair
 
     ModifyScrips => 'Modify Scrips for this queue',                   # loc_pair
     ShowScrips   => 'Display Scrips for this queue',                  # loc_pair
diff --git a/lib/RT/Template_Overlay.pm b/lib/RT/Template_Overlay.pm
index 48d3fac..b520a62 100755
--- a/lib/RT/Template_Overlay.pm
+++ b/lib/RT/Template_Overlay.pm
@@ -215,6 +215,9 @@ sub Create {
         unless ( $self->CurrentUser->HasRight(Right =>'ModifyTemplate', Object => $RT::System) ) {
             return ( undef, $self->loc('Permission Denied') );
         }
+        if ( $args{Type} eq 'Full' && !$self->CurrentUser->HasRight(Right => 'FullTemplates', Object => $RT::System) ) {
+            return ( undef, $self->loc('Permission Denied') );
+        }
         $args{'Queue'} = 0;
     }
     else {
@@ -224,6 +227,9 @@ sub Create {
         unless ( $QueueObj->CurrentUserHasRight('ModifyTemplate') ) {
             return ( undef, $self->loc('Permission Denied') );
         }
+        if ( $args{Type} eq 'Full' && !$QueueObj->CurrentUserHasRight('FullTemplates') ) {
+            return ( undef, $self->loc('Permission Denied') );
+        }
         $args{'Queue'} = $QueueObj->Id;
     }
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list