X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FElements%2FSelectScripCondition;h=ae663c7643fb5eb0688895eeed2403da4d5ecf1e;hp=67438a72a717ddffed2bed4335210d678e7cbb26;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hpb=01352af8e44b7eb70b2b587ca43ab7ca946f038d diff --git a/rt/share/html/Admin/Elements/SelectScripCondition b/rt/share/html/Admin/Elements/SelectScripCondition index 67438a72a..ae663c764 100755 --- a/rt/share/html/Admin/Elements/SelectScripCondition +++ b/rt/share/html/Admin/Elements/SelectScripCondition @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -62,9 +62,19 @@ form.submit()"> <%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'); <%ARGS>