REM "====================================";
REM "Restricts who can run this agent to those in at least one of the specified
role(s). ?Note that 'Enforce a consistent ACL' must be enabled for @UserRoles
to work.";
_roles := "[Admin]";
REM "====================================";
_allowedToRunAgents := (_roles = @UserRoles);
@If(_allowedToRunAgents; ""; @Return(@Prompt([OK]; "Launch Agent"; "You are not
authorized to run agents on this database. ?Contact your database administrator
if you need to run system agents on this database.")));
REM "The normal agent code follows...";
This was first published in November 2000