OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | exoplatform List | May 2007 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [exoplatform] How to find all users by membershiptype:group ?


Thanks Benjamin. I finally ended with something like the following code :

String rolexpression = "owner:/admin";
List<User> users = new ArrayList<User>();
String[] temp = rolexpression.split(":");
String membership = temp[0];
String group = temp[1]; PageList page = organizationService.getUserHandler().findUsersByGroup(group);
List<User> all = page.getAll(); for (User user : all) {
if (securityService.hasMembershipInGroup(user.getUserName(), rolexpression)) {
users.add(user);
}
}
--
Patrice


Benjamin Mestrallet a écrit :
Hi Patrice

You should mix SecurityService methods

public boolean hasMembershipInGroup(String user, String roleExpression) ;
public boolean hasMembershipInGroup(String userId, String membershipName, String groupName);
public boolean isUserInRole(String userName, String role);



And OrganizationService one to handle what you want

HTH

Benjamin

On May 23, 2007, at 3:44 PM, LAMARQUE Patrice GC EUR wrote:

Hello community,

I need to find all users that match a given membershipType:group expression.
For instance, from expression "owner:/admin" , I would like to find all users that belong to the "admin" group with membershiptype "owner".


I could not find a way to do it using that OrganizationService. Can anyone help ?

Thanks,

--
Patrice




--
You receive this message as a subscriber of the exoplatform@xxxxxxxxxxxxx mailing list.
To unsubscribe: mailto:exoplatform-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws






<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.