def METHOD_NAME(specify_usertype, ldap_user):
    """Map the LDAP user to a Specify user type.
    specify_usertype - A namedtuple of the possible user types.
    ldap_user - The LDAP user object that was authenticated.
    Must return one entry from specify_usertype.
    The usertype assignment only occurs at the time of login. Changing
    a user's LDAP group membership will have no effect on logged in
    users until they login after the change.
    """
    # (ldap_group, specify_usertype) in order of decreasing privilege
    mapping = (
        ('specify-admin', specify_usertype.admin),
        ('specify-manager', specify_usertype.manager),
        ('specify-full-access', specify_usertype.full_access),
        ('specify-limited-access', specify_usertype.limited_access),
    )
    # Return the most privileged user type that is mapped to a group
    # the user belongs to.
    for group, usertype in mapping:
        if group in ldap_user.group_names:
            return usertype
    return specify_usertype.guest