UserManager userMgr = getUserManager( theTenant, session );
pPrincipalName = ( (SessionImpl) session ).getJCRName( P_PRINCIPAL_NAME );
Iterator<Authorizable> it = userMgr.findAuthorizables( pPrincipalName, null, UserManager.SEARCH_TYPE_GROUP );
while ( it.hasNext() ) {
Group group = (Group) it.next();
IPentahoRole pentahoRole = convertToPentahoRole( group );
// Exclude the system role from the list of roles to be returned back
if ( !extraRoles.contains( pentahoRole.getName() ) ) {
if ( includeSubtenants ) {
roles.add( pentahoRole );
} else {
if ( pentahoRole.getTenant() != null && pentahoRole.getTenant().equals( theTenant ) ) {
roles.add( pentahoRole );
}
}
}
}