.. versionadded:: 2019.2.0

    List all policy assignments for a resource group.

    :param resource_group: The resource group name to list policy assignments within.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignments_list_for_resource_group testgroup

def policy_assignments_list_for_resource_group(resource_group, **kwargs):  # pylint: disable=invalid-name
    '''
    .. versionadded:: 2019.2.0

    List all policy assignments for a resource group.

    :param resource_group: The resource group name to list policy assignments within.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignments_list_for_resource_group testgroup

    '''
    result = {}
    polconn = __utils__['azurearm.get_client']('policy', **kwargs)
    try:
        policy_assign = __utils__['azurearm.paged_object_to_list'](
            polconn.policy_assignments.list_for_resource_group(
                resource_group_name=resource_group,
                filter=kwargs.get('filter')
            )
        )

        for assign in policy_assign:
            result[assign['name']] = assign
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result