Re: Problem using Struts-menu with role

Sunil_Sahu-g6+mqz/[email protected]
Newsgroups gmane.comp.java.struts-menu.user
Message-ID <OF11292FA0.222EC1BD-ON65257067.0034D092-65257067.00351F64@keane.com>
Hi Marco,

Thanks for your valuable suggestion but i got solution for this problem. 
Matt has provided me solution of this problem that i should configure 
ContextHolderAwareRequestFilter  in my filterChain bean. I have 
implemented this and now its working fine. Menu-items for which logged-on 
user doesn't have rights, would not be even displayed in the browser.

Thanks

Regards
Sunil Sahu







Marco Mistroni <[email protected]> 
Sent by: struts-menu-user-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
08/24/2005 02:49 PM
Please respond to
struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org


To
struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
cc

Subject
Re: [struts-menu] Problem using Struts-menu with role






Hello,
  i am using Acegi & StrutsMenu...
not available menus are shown but are greyed out (you can't select them)..
have you checked your acegi database to have everything correct?

regards
 marco

On 8/24/05, [email protected] <[email protected]> wrote:
> 
> Hi Matt, 
> 
> I am trying to configure struts-menu in my sample applcation but when i 
am
> using "permissons" attribute as "rolesAdapter" in my jsp, those 
menu-items
> in menu-config.xml which have no "roles" attribute is shown in browser. 
> 
> I have configured my menu-config.xml in WEB-INF directory. Following is 
the
> content of menu-config.xml: 
> 
> <MenuConfig> 
>     <Displayers> 
>         <Displayer name="ListMenu"
> type="net.sf.navigator.displayer.ListMenuDisplayer"/> 
>     </Displayers> 
>     <Menus> 
>         <!-- ====================   Administrator Menu 
> =========================== --> 
>         <Menu name="AdminMenu" title="menu.admin" description="Admin 
Menu"
> roles="admin"> 
>             <Item name="am.viewUsers" title="menu.admin.users"
> page="/blank.jsp"/> 
>             <Item name="ReloadContext" title="menu.admin.reload"
> page="/blank1.jsp"/> 
>         </Menu> 
>         <!-- ====================   User Menu 
===========================
> --> 
>         <Menu name="UserMenu" title="menu.user" description="User Menu"
> page="/blank2.jsp" roles="admin,ROLE_USER"/> 
>         <!-- ====================   Upload File Menu 
> =========================== --> 
>         <Menu name="FileUpload" title="menu.selectFile" 
description="File
> Upload" page="/blank3.jsp"/> 
>     </Menus> 
> </MenuConfig> 
> 
> Following the content of left.jsp where i am using this menu 
configuration: 
> <%@ page language="java" pageEncoding="UTF-8"
> contentType="text/html;charset=utf-8" %> 
> <%@ taglib uri="http://struts-menu.sf.net/tag-el"
> prefix="menu" %> 
> 
> <div id="menu"> 
> <menu:useMenuDisplayer name="ListMenu" permissions="rolesAdapter"> 
>     <menu:displayMenu name="AdminMenu"/> 
>     <menu:displayMenu name="UserMenu"/> 
>     <menu:displayMenu name="FileUpload"/> 
> </menu:useMenuDisplayer> 
> </div> 
> 
> Following entry i have made in my
> Applicatiion-Context-Security.xml: 
>     <bean id="filterInvocationInterceptor"
> class="net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor">
>         <property name="authenticationManager"><ref
> local="authenticationManager"/></property> 
>         <property name="accessDecisionManager"><ref
> local="accessDecisionManager"/></property> 
>          <property name="objectDefinitionSource"> 
>             <value> 
>                 CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON 
>                 PATTERN_TYPE_APACHE_ANT 
>                 /*.jsp=admin,ROLE_USER 
>             </value> 
>         </property> 
>     </bean> 
> 
> 
> In the browser only "FileUpload" menu-items is getting displayed, rest 
menu
> items are not getting displayed when log-on to applicaton through 
"admin"
> rights. 
> 
> Is there any other configuration required to run struts-menu with Role.
> Where i have to configure "rolesAdapter". I read somewhere that we 
should
> define this "rolesAdapter" in session or request scope but in Appfuse 
also i
> didn't seen anywhere this setting but in Appfuse it is working fine. 
> I am stuck now please give me your suggestion. 
> 
> Thanks & Regards 
> Sunil Sahu 
> Sr. Software Engineer


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle 
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
struts-menu-user mailing list
struts-menu-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/struts-menu-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.