[Rt-commit] rt branch, 4.0/simple-template-permission, updated. rt-4.0.6-218-g348f1b7

Alex Vandiver alexmv at bestpractical.com
Thu Jun 21 19:56:31 EDT 2012


The branch, 4.0/simple-template-permission has been updated
       via  348f1b76a54d9212b0c310f388050746e6a1d143 (commit)
      from  1a7e87b7083a995c0040fd317e0ee65c4ac46ba6 (commit)

Summary of changes:
 share/html/Admin/Elements/ModifyTemplate |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 348f1b76a54d9212b0c310f388050746e6a1d143
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 21 19:56:27 2012 -0400

    Default the Type according to the permissions of the current user

diff --git a/share/html/Admin/Elements/ModifyTemplate b/share/html/Admin/Elements/ModifyTemplate
index ebe7c73..5746c06 100755
--- a/share/html/Admin/Elements/ModifyTemplate
+++ b/share/html/Admin/Elements/ModifyTemplate
@@ -69,7 +69,10 @@
 
 <%INIT>
 
-$Type = 'Perl' if !$Type;
+unless ($Type) {
+    $Type = $session{'CurrentUser'}->HasRight(Right => 'ExecuteCode', Object => $RT::System) ?
+        'Perl' : 'Simple';
+}
 
 </%INIT>
 
@@ -77,5 +80,5 @@ $Type = 'Perl' if !$Type;
 $Name => ''
 $Description => ''
 $Content => ''
-$Type => 'Perl'
+$Type => ''
 </%ARGS>

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


More information about the Rt-commit mailing list