Re: extending RolesPermissionsAdapter to support Role based menu items ?
Matt Raible <lists-T7vlz3gD7BdF/EzeuO4KJwC/[email protected]>
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Message-ID | <[email protected]> |
On Aug 9, 2004, at 11:29 PM, lixin chu wrote: > Hi, > new to Struts menu (it is really cool). question on > supporting role based menu items. > > it seems that RolesPermissionsAdapter is the one I > should work on. So trying to understand if I should > extend it so I can get user/role info from a database > instead of using container managed role configuration. You could try - I've never done this so I don't know how much advice I could give you. > > is it ok ? how do i config menu so that it will use my > own RolesPermissionsAdatper ? The menu definition only > allows me to put the Role name in, not my own Adapter. You put the adapter into a scope (i.e. session or request) and then refer to it in the taglib: permissions="attributeName". You could likely model your Adapter off of an existing one that does database lookups or talks to an existing user object in session scope. Matt ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285