CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Menu visibility dependant on security level (ASP)

Print topic Send  topic

Author Message
jrp1946
Posted: 02/22/2002, 12:22 PM

I am trying to find out how to display menus depending on whether a user has a security level of 1, 2, 3 or none. I assume these four menus will go into the Header page. From examination of other postings here, I have learned how to achieve this for two menus based on something like ...

if Session("UserRights") = 1
then SetVar "FormMenu_1",""
exit sub
end if

... but I can't work out the logic for extending this to display only one of four menus according to the user's security level, or where to place the code - in the Header Page Open event, or somewhere in the individual menu form Open events?

Thanks to all for previous help. It's a steep learning curve for an amateur, but stimulating.
Nicole
Posted: 02/23/2002, 1:43 AM

Hello,
I'll try to explain on example. Lets assume there're 3 menu forms and only one is to be displayed. Menu_1 is for user with access level = 1, Menu_2 is for user with access level = 2, Menu_3 is for user with access level = 3.
So you should hide two forms.
The code for Menu_1 form would be:
if Session("UserRights") <> 1
then SetVar "FormMenu_1",""
exit sub
end if

The code for Menu_2 form would be:
if Session("UserRights") <> 2
then SetVar "FormMenu_2",""
exit sub
end if

etc.
Hope, it'll help you.
jrp1946
Posted: 02/23/2002, 9:55 PM

Thanks, Nicole. 'Andrew B' also explained this to me in a duplicate posting elsewhere here. For anyone wanting, as I did, to also display a 'public' menu for visitors without user rights, that menu can also be hidden using a similar bit of code in that menu form, for example, if the public menu is called Menu_0 then in the Open event for that form:

if Session("UserRights") <> ""
then SetVar "FormMenu_0",""
exit sub
end if

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.