WebSphere Portal Server - Not able to get users in other group.

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Portal Server > November 2007 > Not able to get users in other group.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Not able to get users in other group.
ashish.ku.jain@gmail.com

2007-11-22, 1:25 pm

I have a requirement to fetch all the users id in a perticular group. I may or may not be part of that user group.<br />
<br />
This is the code I am using. When I log in using wpsadmin user id it doesn't throw any exception but when I login using other id, I am getting below exception.<br />
<br />
Is there any way to get the read only permission to query other group in read only mode. (Even I it's giving error to query ashinja own group.)<br />
Context ctx = new InitialContext();<br />
PortletServiceHome psh = psh = (PortletServiceHome)ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");<br />
pumaService = (PumaHome)psh.getPortletService(PumaHome.class);<br />
} catch (NamingException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}<br />
PumaLocator pumaLocator = pumaService.getLocator(request);<br />
try {<br />
<br />
//pumaLocator.findGroupByIdentifier(arg0)<br />
Group group = pumaLocator.findGroupByIdentifier("cn=hibernian,o=default organization");<br />
List list = pumaLocator.findMembersByGroup(group, true);<br />
Iterator iter = list.iterator(); <br />
while (iter.hasNext()){<br />
Object obj = iter.next();<br />
System.out.println("Users:" + obj);<br />
}<br />
<p />
} catch (PumaSystemException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
} catch (PumaModelException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
} catch (PumaMissingAccessRightsException e) {<br />
// TODO Auto-generated catch block<br />
e.printStackTrace();<br />
}<br />
<p />
<strike>11/22/07 19:31:48:728 IST</strike> 00000040 SystemErr R com.ibm.wps.um.exceptions.impl.MissingAccessRightsExceptionImpl: com.ibm.portal.WpsException: EJPSG0029E: The user id: uid=ashinja,o=default organization
Jim Barnes

2007-11-22, 1:25 pm

the virtual resources user and user groups control access rights when using PUMA, you can give the necessary access rights to those virtual resources to the user or user groups you need and then you should be able to access them in your code<br />
<p />
IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0<br />
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0<br />
<br />
The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com