Prevent form from displaying?

Prevent form from displaying?

Does anyone know if it's possible to prevent a form from displaying based on a condition like whether or not the user is the administrator? For example, I have this deluge script working (somewhat):

on Edit > on Load:
  1. user  =  Users  [User_ID == zoho.loginuserid];
  2. if (user.Role  !=  "Administrator")
  3. {
  4.     alert("Sorry, you don't have permissions to use this feature.");
  5. }
It displays the alert box as expected. What I need is a way to just show the alert box, then when user clicks OK, the form would NOT display. I guess I'm looking for a programmatic way to bail out of the script like "exit" or "die" or something.

Although more work, I could wrap all the field display in a conditional statement and show them if user is the administrator, otherwise show a notes field with the message on it.

Anyone?