What is the user's Role?

Is there a way to get the user role, i.e., Administrator, Developer, or User? I cannot find a function to do that. It would be useful if one wants to write code that only runs for a certain role user.

See “Managing Account Roles” in Help.

There doesn’t seem to be, but there is info(“user”). With a little fooling around you might make a list of users and have the db check if that particular info returned a name from the list. Then I think I’d assign the result to a variable and if the variable wasn’t true the procedure would stop with an alert.

Here’s a little program demonstrating the idea

Approved= "Bradford Brown,Boris Morris"
if arraysearch(Approved, info("user"), 1, ",")>0
    message "Approved"
    message "Denied"

You could make a form to populate the approved list and generate the array.

Apparently I neglected to document the info("loggedinaccountrole") function that does this, but this function has been available since early Panorama X beta versions. I have just written this documentation, of course it is not in your in-app help but you can read it on the web:


Typo in loggedinaccountrole.html: Administrator priviledges (should be privileges)

and again in the same sentence.

4 minutes from uploading the page to correction submitted, that has to be a record! I hadn’t even gone off the page yet! So it was pretty easy to make that correction, thanks Craig!