[jboss-user] [JBoss Portal] - Problem using security, checkPermission()
do-not-reply at jboss.com
Mon Sep 18 13:31:11 EDT 2006
I, i was trying o check the check user permissions to portal pages in order to choose which links to display in a portlet. But i'm getting a little problem.
The code that i use is this:
| MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
| PortalPermissionFactory permissionFactory = (PortalPermissionFactory)MBeanProxy.get(PortalPermissionFactory.class,
| new ObjectName("portal:service=PortalPermissionFactory"), mbeanServer);
| boolean asPermission = permissionFactory.checkPermission(PermissionTypes.PORTAL_OBJECT, uri, PortalObjectPermission.VIEW);
The problem is, if the page permissions is checked as Uncheck, it return true, but if is checked to a role that the current user belongs it returns false.
I also tried the way that is described in the Chapter 5 of the Jboss Portal 2.2, and the result is the same.
I think that the PortalSubject that it uses is not the user that i'm using, for some reason that i can't understand. Do i need to do something before or the portal should know how is the user that is looged in?
I'm using JBoss AS 4.0.3SP1 and Jboss Portal 2.2.
Thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972382#3972382
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972382
More information about the jboss-user