[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-227-g2054613

Shawn Moore sartak at bestpractical.com
Wed Jul 28 22:58:39 EDT 2010


The branch, new-style-templates has been updated
       via  20546138ce2d024a436974b0700bb0a28510ef01 (commit)
      from  ee192cfa38bf9ddec34286bfc723505c82687d27 (commit)

Summary of changes:
 etc/upgrade/3.9.1/content  |    6 +++---
 lib/RT/Queue_Overlay.pm    |    2 +-
 lib/RT/Template_Overlay.pm |   14 +++++++-------
 t/web/template.t           |    8 ++++----
 4 files changed, 15 insertions(+), 15 deletions(-)

- Log -----------------------------------------------------------------
commit 20546138ce2d024a436974b0700bb0a28510ef01
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jul 28 23:00:08 2010 -0400

    Drop the 's' in ModifyPerlTemplates for consistency with ModifyTemplate

diff --git a/etc/upgrade/3.9.1/content b/etc/upgrade/3.9.1/content
index bdf7a2c..d6f6e83 100644
--- a/etc/upgrade/3.9.1/content
+++ b/etc/upgrade/3.9.1/content
@@ -25,7 +25,7 @@
     },
     sub {
         use strict;
-        $RT::Logger->debug('Adding ModifyPerlTemplates right to principals that currently have ModifyTemplate');
+        $RT::Logger->debug('Adding ModifyPerlTemplate right to principals that currently have ModifyTemplate');
 
         my $acl = RT::ACL->new($RT::SystemUser);
         $acl->Limit(
@@ -39,12 +39,12 @@
             my $principal = $ace->PrincipalObj;
 
             my ($ok, $msg) = $principal->GrantRight(
-                Right => 'ModifyPerlTemplates',
+                Right => 'ModifyPerlTemplate',
                 Object => $object,
             );
 
             if (!$ok) {
-                $RT::Logger->warn("Unable to grant ModifyPerlTemplates on principal " . $principal->id . ": $msg");
+                $RT::Logger->warn("Unable to grant ModifyPerlTemplate on principal " . $principal->id . ": $msg");
             }
         }
     },
diff --git a/lib/RT/Queue_Overlay.pm b/lib/RT/Queue_Overlay.pm
index 7a20693..7201007 100755
--- a/lib/RT/Queue_Overlay.pm
+++ b/lib/RT/Queue_Overlay.pm
@@ -94,7 +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
-    ModifyPerlTemplates => 'Modify templates with unlimited code execution', # loc_pair
+    ModifyPerlTemplate  => '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 f1cb9f1..14d2ad4 100755
--- a/lib/RT/Template_Overlay.pm
+++ b/lib/RT/Template_Overlay.pm
@@ -215,7 +215,7 @@ sub Create {
         unless ( $self->CurrentUser->HasRight(Right =>'ModifyTemplate', Object => $RT::System) ) {
             return ( undef, $self->loc('Permission Denied') );
         }
-        if ( $args{Type} eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ModifyPerlTemplates', Object => $RT::System) ) {
+        if ( $args{Type} eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ModifyPerlTemplate', Object => $RT::System) ) {
             return ( undef, $self->loc('Permission Denied') );
         }
         $args{'Queue'} = 0;
@@ -227,7 +227,7 @@ sub Create {
         unless ( $QueueObj->CurrentUserHasRight('ModifyTemplate') ) {
             return ( undef, $self->loc('Permission Denied') );
         }
-        if ( $args{Type} eq 'Perl' && !$QueueObj->CurrentUserHasRight('ModifyPerlTemplates') ) {
+        if ( $args{Type} eq 'Perl' && !$QueueObj->CurrentUserHasRight('ModifyPerlTemplate') ) {
             return ( undef, $self->loc('Permission Denied') );
         }
         $args{'Queue'} = $QueueObj->Id;
@@ -597,7 +597,7 @@ sub CurrentUserHasQueueRight {
 
 =head2 SetType
 
-If setting Type to Perl, require the ModifyPerlTemplates right on the queue.
+If setting Type to Perl, require the ModifyPerlTemplate right on the queue.
 
 =cut
 
@@ -605,7 +605,7 @@ sub SetType {
     my $self    = shift;
     my $NewType = shift;
 
-    if ($NewType eq 'Perl' && !$self->CurrentUserHasQueueRight('ModifyPerlTemplates')) {
+    if ($NewType eq 'Perl' && !$self->CurrentUserHasQueueRight('ModifyPerlTemplate')) {
         return ( undef, $self->loc('Permission Denied') );
     }
 
@@ -614,7 +614,7 @@ sub SetType {
 
 =head2 SetQueue
 
-When changing the queue, make sure the current user has ModifyPerlTemplates on the
+When changing the queue, make sure the current user has ModifyPerlTemplate on the
 new queue if the type is Perl.
 
 Templates can't change Queue in the UI (yet?).
@@ -628,8 +628,8 @@ sub SetQueue {
     my $NewQueueObj = RT::Queue->new( $self->CurrentUser );
     $NewQueueObj->Load($NewQueue);
 
-    if ( $self->Type eq 'Perl' && !$NewQueueObj->CurrentUserHasRight('ModifyPerlTemplates') ) {
-        return ( undef, $self->loc('Permission Denied. You do not have ModifyPerlTemplates on the new queue.') );
+    if ( $self->Type eq 'Perl' && !$NewQueueObj->CurrentUserHasRight('ModifyPerlTemplate') ) {
+        return ( undef, $self->loc('Permission Denied. You do not have ModifyPerlTemplate on the new queue.') );
     }
 
     return $self->_Set( Field => 'Queue', Value => $NewQueueObj->id );
diff --git a/t/web/template.t b/t/web/template.t
index c153c37..18113d4 100644
--- a/t/web/template.t
+++ b/t/web/template.t
@@ -47,17 +47,17 @@ $m->submit;
 
 $m->title_is(q{Modify template Resolved}, 'modifying the Resolved template');
 $m->form_name('ModifyTemplate');
-is($m->value('Type'), 'Simple', 'need the ModifyPerlTemplates right to update Type to Perl');
+is($m->value('Type'), 'Simple', 'need the ModifyPerlTemplate right to update Type to Perl');
 $m->content_contains('Permission Denied');
 
 ok( RT::Test->add_rights(
-    { Principal => $user_a, Right => [qw(ModifyPerlTemplates)] },
-), 'add ModifyPerlTemplates rights');
+    { Principal => $user_a, Right => [qw(ModifyPerlTemplate)] },
+), 'add ModifyPerlTemplate rights');
 
 $m->field(Type => 'Perl');
 $m->submit;
 
 $m->title_is(q{Modify template Resolved}, 'modifying the Resolved template');
 $m->form_name('ModifyTemplate');
-is($m->value('Type'), 'Perl', 'now that we have ModifyPerlTemplates we can update Type to Perl');
+is($m->value('Type'), 'Perl', 'now that we have ModifyPerlTemplate we can update Type to Perl');
 

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


More information about the Rt-commit mailing list