[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-229-ga2deb55

Shawn Moore sartak at bestpractical.com
Thu Jul 29 23:52:22 EDT 2010


The branch, new-style-templates has been updated
       via  a2deb5550729e6f399243391f21d209323e2a8e0 (commit)
      from  8da05c4a878387e26bb2d21024a176de0b95a875 (commit)

Summary of changes:
 lib/RT/Scrip_Overlay.pm |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit a2deb5550729e6f399243391f21d209323e2a8e0
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Jul 29 23:54:05 2010 -0400

    ExecutePerl is required to create and update scrips with user-defined code

diff --git a/lib/RT/Scrip_Overlay.pm b/lib/RT/Scrip_Overlay.pm
index 6c2cbd5..224f237 100755
--- a/lib/RT/Scrip_Overlay.pm
+++ b/lib/RT/Scrip_Overlay.pm
@@ -106,6 +106,14 @@ sub Create {
         @_
     );
 
+    if (length($args{CustomPrepareCode}) || length($args{CustomCommitCode}) || length($args{CustomIsApplicableCode})) {
+        unless ( $self->CurrentUser->HasRight( Object => $RT::System,
+                                               Right  => 'ExecutePerl' ) )
+        {
+            return ( 0, $self->loc('Permission Denied') );
+        }
+    }
+
     unless ( $args{'Queue'} ) {
         unless ( $self->CurrentUser->HasRight( Object => $RT::System,
                                                Right  => 'ModifyScrips' ) )
@@ -503,12 +511,28 @@ sub Commit {
 # does an acl check and then passes off the call
 sub _Set {
     my $self = shift;
+    my %args = (
+        Field => undef,
+        Value => undef,
+        @_,
+    );
 
     unless ( $self->CurrentUserHasRight('ModifyScrips') ) {
         $RT::Logger->debug(
                  "CurrentUser can't modify Scrips for " . $self->Queue . "\n" );
         return ( 0, $self->loc('Permission Denied') );
     }
+
+
+    if (length($args{Value})) {
+        if ($args{Field} eq 'CustomIsApplicableCode' || $args{Field} eq 'CustomPrepareCode' || $args{Field} eq 'CustomCommitCode') {
+            unless ( $self->CurrentUser->HasRight( Object => $RT::System,
+                                                   Right  => 'ExecutePerl' ) )
+                return ( 0, $self->loc('Permission Denied') );
+            }
+        }
+    }
+
     return $self->__Set(@_);
 }
 

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


More information about the Rt-commit mailing list