This content has been marked as final.
Show 3 replies
-
1. Re: Portlet customization with respect to user rloes
theute Jun 19, 2007 8:05 AM (in response to georgy)Yes please read the section "PLT.20.3 Programmatic Security"
of the portlet spec.
You must define the role Administrator in your portlet.xml descriptor. -
2. Re: Portlet customization with respect to user rloes
brownfielda Jun 20, 2007 1:38 PM (in response to georgy)I am having problems with the same thing, actually.
web.xml contains:<security-role> <description/> <role-name>Administrators</role-name> </security-role> <security-role> <description/> <role-name>Users</role-name> </security-role>
portlet.xml contains:<security-role-ref> <role-name>Users</role-name> <role-link>Users</role-link> </security-role-ref> <security-role-ref> <role-name>Administrators</role-name> <role-link>Administrators</role-link> </security-role-ref>
and I'm trying to run the following code:if(request.isUserInRole("Administrators")) System.out.println("Administrators"); else if(request.isUserInRole("Users")) System.out.println("Users"); else System.out.println("user is in an unknown role");
The final else clause catches everything, no matter which account logs in. I've tried this in many different ways, changing capitalization and whether or not there is an 's' on the end. Nothing has worked so far.
Is there something I'm missing in the XML configs? -
3. Re: Portlet customization with respect to user rloes
brownfielda Jun 21, 2007 9:31 AM (in response to georgy)D'OH! Forgot that there is both a role-name and a display role-name. I was going by the display role-names in the provided Role Management portlet.
Sorry for the stupidity and waste of forum space.
--Andrew