-
15. Re: how can i get current PortalNode
k3nnymusic Jul 26, 2007 3:27 AM (in response to k3nnymusic)Please tell mi the way, which I can do this fast. What classes shoudl I use?
-
16. Re: how can i get current PortalNode
theute Jul 26, 2007 4:25 AM (in response to k3nnymusic)
You will get only the nodes on which the user has read access.
Check the catalog portlet, it does what you are trying to do -
17. Re: how can i get current PortalNode
k3nnymusic Jul 26, 2007 4:30 AM (in response to k3nnymusic)The problem is I have got nodes off all pages inlude this where I haven't got permission. I use jboss portal 2.4.2. There are in 2.6 this bug fixed? I guess you are talking about 2.6, right?
-
18. Re: how can i get current PortalNode
theute Jul 26, 2007 4:36 AM (in response to k3nnymusic)Yes i was talking about 2.6.
In 2.4 it is different, but if you look at the catalog portlet you should be able to figure out how to access the correct service to check for permissions. -
19. Re: how can i get current PortalNode
k3nnymusic Jul 26, 2007 11:19 AM (in response to k3nnymusic)I trying to do that in 2.4.2 but I have got one more trouble.
I can't findorg.jboss.portal.core.impl.api.CorePortalNode
in any jar, and sources in this version of portal, so I don't know how can I get node URI string toPortalObjectPermission(java.lang.String uri, int mask)
constructor.
I tried to get string uri from PortalNodeURL, but then I have got unhandled exception type forportalAuthorizationManagerFactory.getManager().checkPermission(perm)
There is any possibility to import this class from newest version of portal, or to use other class?
Oryginal code from CatalogPortlet.java, with my diferences:CorePortalNode pn = (CorePortalNode)parentSibling; //- I dont have CorePortalNode Class PortalObjectPermission perm = new PortalObjectPermission(pn.getObjectId(), PortalObjectPermission.VIEW_MASK); //so I haven't got pn object if (portalAuthorizationManagerFactory.getManager().checkPermission(perm)) { allowed = true; } else { allowed = false; }
-
20. Re: how can i get current PortalNode
k3nnymusic Jul 26, 2007 11:26 AM (in response to k3nnymusic)sorry I know whats is the reason of unhandlet excepotion,
but I don't know if I can Use URL like URI like this:PortalNodeURL secURL = resp.createRenderURL(page); PortalObjectPermission perm = new PortalObjectPermission(secURL.toString(),2); if (portalAuthorizationManagerFactory.getManager().checkPermission(perm))
-
21. Re: how can i get current PortalNode
k3nnymusic Jul 26, 2007 11:29 AM (in response to k3nnymusic)one more mistake, replace 2 to PortalObjectPermission.VIEW_MASK
is this code correct?PortalNodeURL secURL = resp.createRenderURL(page); PortalObjectPermission perm = new PortalObjectPermission(secURL.toString(),PortalObjectPermission.VIEW_MASK); if (portalAuthorizationManagerFactory.getManager().checkPermission(perm))
-
22. Re: how can i get current PortalNode
k3nnymusic Jul 27, 2007 5:47 AM (in response to k3nnymusic)Could you tell me how should looks URI in PortalObjectPermission constructor argument?
And how can I have it without CorePortalNode object???? -
23. Re: how can i get current PortalNode
k3nnymusic Jul 27, 2007 9:04 AM (in response to k3nnymusic)There is any possibility to do it in 2.4.2 version? I am a little scared about you don't anaswer:) Please tell me the easiest way