[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-288-ga805b84

Shawn Moore sartak at bestpractical.com
Tue Aug 10 00:21:52 EDT 2010


The branch, new-style-templates has been updated
       via  a805b840f796d93344ec18dcee12fff82ffb83ca (commit)
      from  503eeafb8465da8cfb821cb92e857dbc544e21bc (commit)

Summary of changes:
 share/html/Admin/Elements/SelectScripAction    |   13 +++++++++++--
 share/html/Admin/Elements/SelectScripCondition |   14 ++++++++++++--
 2 files changed, 23 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit a805b840f796d93344ec18dcee12fff82ffb83ca
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Tue Aug 10 00:23:47 2010 -0400

    Remove user-defined from condition/action lists when lacking ExecuteCode

diff --git a/share/html/Admin/Elements/SelectScripAction b/share/html/Admin/Elements/SelectScripAction
index 47898e4..5e256fb 100755
--- a/share/html/Admin/Elements/SelectScripAction
+++ b/share/html/Admin/Elements/SelectScripAction
@@ -59,10 +59,19 @@
 
 <%INIT>
 my $ScripActions = RT::ScripActions->new($session{'CurrentUser'});
-$ScripActions->UnLimit;
-$ScripActions->OrderBy(FIELD => 'Name');
 
+# hide user-defined if the user can't execute code
+if ($session{CurrentUser}->HasRight(Object => $RT::System, Right => 'ExecuteCode')) {
+    $ScripActions->UnLimit;
+} else {
+    $ScripActions->Limit(
+        FIELD    => 'ExecModule',
+        OPERATOR => '!=',
+        VALUE    => 'UserDefined',
+    );
+}
 
+$ScripActions->OrderBy(FIELD => 'Name');
 
 </%INIT>
 <%ARGS>
diff --git a/share/html/Admin/Elements/SelectScripCondition b/share/html/Admin/Elements/SelectScripCondition
index f146f96..f487aa0 100755
--- a/share/html/Admin/Elements/SelectScripCondition
+++ b/share/html/Admin/Elements/SelectScripCondition
@@ -59,9 +59,19 @@
 
 <%INIT>
 my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'});
-$ScripConditions->UnLimit;
-$ScripConditions->OrderBy(FIELD => 'Name');
 
+# hide user-defined if the user can't execute code
+if ($session{CurrentUser}->HasRight(Object => $RT::System, Right => 'ExecuteCode')) {
+    $ScripConditions->UnLimit;
+} else {
+    $ScripConditions->Limit(
+        FIELD    => 'ExecModule',
+        OPERATOR => '!=',
+        VALUE    => 'UserDefined',
+    );
+}
+
+$ScripConditions->OrderBy(FIELD => 'Name');
 
 </%INIT>
 <%ARGS>

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


More information about the Rt-commit mailing list