public List<CmsGroup> getGroupsOfUser(
        CmsRequestContext context,
        String username,
        String ouFqn,
        boolean includeChildOus,
        boolean readRoles,
        boolean directGroupsOnly,
        String remoteAddress)
    throws CmsException {

        CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
        List<CmsGroup> result = null;
        try {
            result = m_driverManager.getGroupsOfUser(
                dbc,
                CmsOrganizationalUnit.removeLeadingSeparator(username),
                CmsOrganizationalUnit.removeLeadingSeparator(ouFqn),
                includeChildOus,
                readRoles,
                directGroupsOnly,
                remoteAddress);
        } catch (Exception e) {
            dbc.report(null, Messages.get().container(Messages.ERR_GET_GROUPS_OF_USER_2, username, remoteAddress), e);
        } finally {
            dbc.clear();
        }
        return result;
    }
public List < CmsGroup > getGroupsOfUser ( CmsRequestContext context , String username , String ouFqn , boolean includeChildOus , boolean readRoles , boolean directGroupsOnly , String remoteAddress ) throws CmsException { CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; List < CmsGroup > result = null ; try { result = m_driverManager . getGroupsOfUser ( dbc , CmsOrganizationalUnit . removeLeadingSeparator ( username ) , CmsOrganizationalUnit . removeLeadingSeparator ( ouFqn ) , includeChildOus , readRoles , directGroupsOnly , remoteAddress ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_GET_GROUPS_OF_USER_2 , username , remoteAddress ) , e ) ; } finally { dbc . clear ( ) ; } return result ; }
Returns the list of groups to which the user directly belongs to.<p>

@param context the current request context
@param username The name of the user
@param ouFqn the fully qualified name of the organizational unit to restrict the result set for
@param includeChildOus include groups of child organizational units
@param readRoles if to read roles or groups
@param directGroupsOnly if set only the direct assigned groups will be returned, if not also indirect roles
@param remoteAddress the IP address to filter the groups in the result list

@return a list of <code>{@link CmsGroup}</code> objects filtered by the given IP address

@throws CmsException if operation was not successful