Javascript Equivelant? Or Suggestion on to go about doing this?

I currently have a web enabled database. One that database, there is a UserRole that I am using to allow only certain people access to edit the documents in this database.

The information should be accesible for all users anonymously when accessing via a browser. I have to provide and “Edit Document” button that can be clicked to edit the document. When the edit button is hit, the user is prompted for login credentials.

At this point, here is what I need to happen. When the user is authenticated, a check should be performed to see if they are a member of the sepecif role required to edit the document. If they are not, kick back a message stating that access is denied, and return them to the read only version of the document.

I tried using the following code on the button, although I do not think it is supported via the web…

@If (@IsNotMember(“[UserCreator]”;@UserRoles);@Prompt([Ok];“Access Denied”; “You are not permitted to make edits to this database”);@Command([EditDocument]))

Is there an easy way to do this in Javascript, or am I going about this all wrong?

Subject: Why not just use the ACL?

If the goal is for the user can either edit documents or not for the whole database, why just make them a Reader instead of an Editor whose editing rights are revoked by Javascript and hide-whens?

I’d make them Readers…

Dave

Chub Toad, LLC