To display Dynamic Menus & Links according to the Role ???
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   R_Kannan
Posted On:   Saturday, September 4, 2004 11:03 PM

hi, I need to display dynamic Menus according to the User who logs in based on his Role. I am implementing the above functionality in the following way , Authenticating the Username & password throgh LDAP , Once Authorised ,LDAP will fetch the role id for that User and put it in Session, In my MainMenu.jsp & all SubMenu.jsp , I will retreive the roleid from the Session , and then I am a writing a logic to decide whether the current role is eligible to see all or partial or no links inside MainMenu.jsp & each SubMenu.jsp . Wants to know if there are any feature in Struts to implement the    More>>

hi,

I need to display dynamic Menus according to the
User who logs in based on his Role.

I am implementing the above functionality in the following way ,



  • Authenticating the Username & password throgh LDAP ,

  • Once Authorised ,LDAP will fetch the role id for that User and put it in Session,

  • In my MainMenu.jsp & all SubMenu.jsp , I will retreive the roleid from the Session ,

  • and then I am a writing a logic to decide whether the current role is eligible to see all or partial or no links inside MainMenu.jsp & each SubMenu.jsp .



Wants to know if there are any feature in Struts to implement the same ,something like a configurable file to map each Role versus Menus or
please specify better ways to handle this ?


Thanks,
Ranga.R    <<Less

Re: To display Dynamic Menus & Links according to the Role ???

Posted By:   Malar_K  
Posted On:   Monday, September 6, 2004 12:01 AM

Hi,


We have implemented such a functionality in our project. But we were using siteminder for security.


We used taglib class which extends BodyTagSupport. It takes a mandatory attribute, roleid. In the taglib class, check whether the role is admin(or anything u want) then u display the link(or menu) in the jsp else u skip the body.


Add a user


Hope this is useful.


regards


Malar
About | Sitemap | Contact