* org.exoplatform.services.security.Authenticator#createIdentity(java.lang
* .String)
*/
public Identity createIdentity(String userId) throws Exception
{
Set<MembershipEntry> entries = new MembershipHashSet();
Collection<Membership> memberships;
begin(orgService);
try
{
memberships = orgService.getMembershipHandler().findMembershipsByUser(userId);
}
finally
{
end(orgService);
}
if (memberships != null)
{
for (Membership membership : memberships)
entries.add(new MembershipEntry(membership.getGroupId(), membership.getMembershipType()));
}
if (rolesExtractor == null)
return new Identity(userId, entries);
return new Identity(userId, entries, rolesExtractor.extractRoles(userId, entries));
}