myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjakie <>
Subject Trinidad XMLMenuModel: dynamically constructing menus based on access-rights?
Date Fri, 30 Jan 2009 09:10:38 GMT

Hello all,

Is it with a XMLMenuModel possible to dynamically "influence"/determine the
menu items that get rendered or not?

Basic problem/idea: we have an application with a large number of menu and
submenu items. The application is used by users with different roles. Each
role has access to different parts of the application. A user with a certain
role should only see the menu items to which that role is authorized.

We want to define the menu as an XMLMenuModel in one XML file and determine
(dynamically) the rendering of menu items based on the access-rights of the
role(s) of the user who is logged on.

We tried several solutions but none of them solved our problem.
Now we are thinking of two possible approaches:

1) "Filter" the nodes of them menu XML that is being read by the
XMLMenuModel when it is creating its model. But we could not determine
how/where to "hook in" our filter to do this. Maybe we can use the
source-property of the managed bean to define an URI of a servlet?

2) MenuContentHandlerImpl : define our own MenuContentHandlerImpl. But we
could not figure out how to "register" our own MenuContentHandlerImpl with
the XMLMenuModel.

Could anyone please advice if one of these approaches is the way to go? And
if so, how to go about it? Or should we take a completely different
approach? Could we use Custom Node Attributes maybe?

Any help/insight will be greatly appreciated!


View this message in context:
Sent from the MyFaces - Users mailing list archive at

View raw message