+# 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');