def access_settings_to_dict(control_access_params):
    """Convert a lxml.objectify.ObjectifiedElement access settings to dict.

    :param lxml.objectify.ObjectifiedElement control_access_params: an object
        containing EntityType.CONTROL_ACCESS_PARAMS XML data.

    :return: dict representation of access control settings.

    :rtype: dict
    """
    result = {}
    if hasattr(control_access_params, 'IsSharedToEveryone'):
        result['is_shared_to_everyone'] = control_access_params[
            'IsSharedToEveryone']
    if hasattr(control_access_params, 'EveryoneAccessLevel'):
        result['everyone_access_level'] = control_access_params[
            'EveryoneAccessLevel']
    if hasattr(control_access_params, 'AccessSettings') and hasattr(
        control_access_params.AccessSettings, 'AccessSetting') and len(
        control_access_params.AccessSettings.AccessSetting) > 0:
        n = 1
        for access_setting in list(control_access_params.AccessSettings.
            AccessSetting):
            access_str = 'access_settings'
            if hasattr(access_setting, 'Subject'):
                result['%s_%s_subject_name' % (access_str, n)
                    ] = access_setting.Subject.get('name')
            if hasattr(access_setting, 'Subject'):
                result['%s_%s_subject_href' % (access_str, n)
                    ] = access_setting.Subject.get('href')
            if hasattr(access_setting, 'Subject'):
                result['%s_%s_subject_type' % (access_str, n)
                    ] = access_setting.Subject.get('type')
            if hasattr(access_setting, 'AccessLevel'):
                result['%s_%s_access_level' % (access_str, n)
                    ] = access_setting.AccessLevel
            n += 1
    return result
