-
1. Re: Jboss Portal authentication
marcuspocus Mar 7, 2005 9:16 AM (in response to marcuspocus)This is actual code inside a portlet doEdit() :
if(request.getUserPrincipal() != null)
{
Principal p = request.getUserPrincipal();
getPortletContext().log("UserName : " + p.getName());
getPortletContext().log(" In Admins role : " + request.isUserInRole("Admins"));
getPortletContext().log(" In Users role : " + request.isUserInRole("Users"));
}
Every call to "isUserInRole" return false -
2. Re: Jboss Portal authentication
roy.russo Mar 7, 2005 10:44 AM (in response to marcuspocus)To use JBoss Portal permissions, your portlet should extend JBossPortlet. For a simple example, look at org.jboss.portal.core.portlet.role.RolePortlet. You will check for role permissions like this then:
req.hasPermission("Admin") -
3. Re: Jboss Portal authentication
marcuspocus Mar 7, 2005 11:13 AM (in response to marcuspocus)Ok, thanks, that'll work for now, but this isn't jsr168 compliant, no?
-
4. Re: Jboss Portal authentication
roy.russo Mar 7, 2005 11:34 AM (in response to marcuspocus)I believe it is. We are extending the framework to some degree allowing for fine-grained security and tying to JAAS.
-
5. Re: Jboss Portal authentication
theute Mar 7, 2005 11:54 AM (in response to marcuspocus)No, isUserInRole is JSR168 compliant,if it returns always false, it could be a bug, we are not using that feature, we will look at it.
hasPermissions stuff is a JBoss Portal very convenient extension to JSR168 portlets -
6. Re: Jboss Portal authentication
julien1 Mar 7, 2005 2:37 PM (in response to marcuspocus)it is a big in the tomcat/jboss integration.
it has been fixed in jboss-4.0.2beta (not out yet but soon). I have had not tested it yet personnally. -
7. Re: Jboss Portal authentication
marcuspocus Mar 7, 2005 3:54 PM (in response to marcuspocus)Ahhh!!!
That's more like it... -
8. Re: Jboss Portal authentication
ego2002 Dec 30, 2005 10:52 AM (in response to marcuspocus)I've got the same problem with isUserInRole... it returns always false...
Has it been debugged in 2.2 version of the portal, please?
Thanks a lot.
Il Dima -
9. Re: Jboss Portal authentication
julien1 Jan 1, 2006 11:49 AM (in response to marcuspocus)did you declare your role in portlet.xml ?
-
10. Re: Jboss Portal authentication
ego2002 Jan 18, 2006 9:34 AM (in response to marcuspocus)Oh... I didn't know they had to be declared in portlet.xml...
I read they had to be declared in jboss-portlet.xml... that was the reason they didn't work...
THANKS A LOT... Now it's all simpler!!
Il Dima