This topic is locked

Modify Menu Not Working

8/13/2012 12:06:05 PM
ASPRunnerPro General questions
G
gdmacdo author

I am trying to modify the menu. If the session group is a TCHR, the Student Demographics menu link should be hidden (there are a total of 6 menu items - each with different names). This is the code in my Menu item:Modify section:
if Session("GroupODR")<>"SADM" then

title = menuItem.getTitle()

if title="Student Demographics" then

ModifyMenuItem = false

end if

end if

ModifyMenuItem = true
This does not hide the menu. To test if the code appears to be working, I utilized this code and I receive the text Student Demographics on the TCHR menu page but not on the SADM menu page :
if Session("GroupODR")<>"SADM" then

title = menuItem.getTitle()

if title="Student Demographics" then

response.write title
end if

end if

ModifyMenuItem = true
Can anyone help why the menu item would not be hidden but would display proper text based on security? Thank you

Admin 8/13/2012

This doesn't hide anything because you added the following line at the end of event:

ModifyMenuItem = true


This means your logic will be overridden every time and menu item will be shown. You need to modify your code so ModifyMenuItem stays being false when you need to hide the item.

G
gdmacdo author 8/13/2012

I changed the code to the following and the entire menu disappears for the TCHR. Is there a parameter I am missing to state that just the variable title is supposed to be hidden?:
if session("GroupODR")<>"SADM" then

title = menuItem.getTitle()

if title="Student Demographics" then

modifymenuitem = false
end if

else modifymenuitem = true

end if
And to clarify. If SADM signs in using the above code, they see all 6 menu items (as expected). If TCHR signs in, they see NO menu items. The intent is that TCHR would see 5 of the 6 menu items.



This doesn't hide anything because you added the following line at the end of event:

ModifyMenuItem = true


This means your logic will be overridden every time and menu item will be shown. You need to modify your code so ModifyMenuItem stays being false when you need to hide the item.

Admin 8/14/2012

Greg,
there is a logic error somewhere in your code.
There are no additional parameters to set. You just need to set ModifyMenuItem value to false for those (and for those only) items you need to hide.
If you have a current support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

lefty 8/26/2012



Greg,
there is a logic error somewhere in your code.
There are no additional parameters to set. You just need to set ModifyMenuItem value to false for those (and for those only) items you need to hide.
If you have a current support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


Was looking at this post . If I understand it right ? Just add another field to user login table and assign groups . Then use advanced security and set permissions for that group . Menu item will not show up for those users or will based on the advanced security settings in the admin area . If you don't want to assign each user in the advanced security then just make two groups one as SADM and one as Student Demographics . This basically makes your code not needed .

Hope this helps if I understand your goal here? If there is no login then this will obivously not work. But since there is a group session I am assuming there is .

G
gdmacdo author 9/1/2012

Thanks for the reply. I am using Active Directory for the security. Normally, this was how I hid a menu but it is not an option under AD.



Was looking at this post . If I understand it right ? Just add another field to user login table and assign groups . Then use advanced security and set permissions for that group . Menu item will not show up for those users or will based on the advanced security settings in the admin area . If you don't want to assign each user in the advanced security then just make two groups one as SADM and one as Student Demographics . This basically makes your code not needed .

Hope this helps if I understand your goal here? If there is no login then this will obivously not work. But since there is a group session I am assuming there is .