Can I find out the user's Role?


Is there a way to find out the user’s role? I.e, administrator, developer, or user? I would like to change the window and possibly menu appearance depending on the role. I see that there is already some control over this with the Database Options…


According to the Help file you should be able to get this value using `dbinfo(“level”):

The “level” option returns a number that indicates the privilege level for this database: 0 = author mode, 1 = user mode, or 2 = custom mode.

Unfortunately this does not work and you get a warning that "dbinfo( function does not have a [LEVEL] option. If you run displaydata dumpdictionary(dbinfo()) you get a list of all available options but the level option is not listed. I don’t know of any other method of getting this information at this time. I have filed a Bitbucket report on this issue #526.


Having asked question, I no longer think that I need to do that. I can get the control I want through the Database Options… choices plus control of the Action Menu. For those who haven’t figured this out already, if you restrict access to the standard UI, then the user will not see the View Menu at all, losing access to the Data Sheet, forms, procedures, View Organizer, etc. They will be limited to the interface that you program for the user.


I think the mistake was including that in the documentation. I think it was just copied from the Panorama 6 documentation. Panorama X doesn’t have author, user, and custom levels. It has administrator, developer, and user roles, and you can specify which privileges each role has. See for the details.