X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FElements%2FSelectScripAction;h=92902f2793b4752c4fcf771004eb7b8b901b83a1;hp=425028dbaa786af9ce9c4560f0e11629d00ffc09;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941 diff --git a/rt/share/html/Admin/Elements/SelectScripAction b/rt/share/html/Admin/Elements/SelectScripAction index 425028dba..92902f279 100755 --- a/rt/share/html/Admin/Elements/SelectScripAction +++ b/rt/share/html/Admin/Elements/SelectScripAction @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -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'); <%ARGS>