You can show/hide Menus based on user roles thanks to the
RolesPermissionsAdapter that's automatically exposed to Struts Menu.
The following article might help you write your own adapter that keys
showing/hiding logic based on something else.

http://struts-menu.sourceforge.net/security.html

Matt

On 4/20/07, snehalsao <[EMAIL PROTECTED]> wrote:

I am using AppFuse and Struts menu 2.4.2 for the first time.

The menu-config.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<MenuConfig>
    <Displayers>
        <Displayer name="Velocity"
type="net.sf.navigator.displayer.VelocityMenuDisplayer"/>
    </Displayers>
    <Menus>
        <Menu name="MainMenu" title="mainMenu.title" page="/mainMenu.html"/>
        <Menu name="EditMenu" title="menu.edit" description="Edit Menu"
roles="admin">
            <Item name="Change Password" title="menu.edit.changePassword"
page="/cp.jsp"/>
            <Item name="Change Privileges"
title="menu.edit.changePrivileges" page="/changePrivileges.html"/>
        </Menu>
        <Menu name="ListMenu" title="menu.list" description="List Menu"
roles="admin">
            <Item name="SearchMenu" title="menu.search"
page="/searchForm.html"/>
            <Item name="ViewUsers" title="menu.list.users"
page="/users.html"/>
        </Menu>
        <Menu name="HelpMenu" title="menu.help" description="Help Menu">
            <Item name="Orion5 Users Help" title="menu.help.usersHelp"
page="/usersHelp.html"/>
            <Item name="About Orion5 Users" title="menu.help.about"
page="/about.html"/>
        </Menu>
        <Menu name="Logout" title="user.logout" page="/logout.jsp"
roles="admin,user"/>
    </Menus>
</MenuConfig>

The first page that the application displays is the login.jsp. It shows
Logon, Main, and Help Menu.
When the user logs on the page mainMenu.html is displayed. That shows Main,
Edit, List, Help, and Logoff Menu. The "Change Password" and "Change
Privileges" menu items under Edit menu are displayed
on this page. I don't want it to be displayed here. When the user list is
displayed the page is
users.html. I want those two items to be displayed in Edit menu for this
page.
I need to understand how the menu display works and how can I control it.

Any help is appreciated.
--
View this message in context: 
http://www.nabble.com/How-to-hide-and-or-disable-menu-items-on-different-pages-for-the-same-logged-in-user--tf3620695s2369.html#a10110485
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to