X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FElements%2FSelectScripCondition;h=1023df6e0207b7be7fc8015fb14652ee176aba69;hb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;hp=67438a72a717ddffed2bed4335210d678e7cbb26;hpb=01352af8e44b7eb70b2b587ca43ab7ca946f038d;p=freeside.git diff --git a/rt/share/html/Admin/Elements/SelectScripCondition b/rt/share/html/Admin/Elements/SelectScripCondition index 67438a72a..1023df6e0 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-2012 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>