def get_policies_for_user(user, policies):
    """
    Find policies that apply to a given user

    user / string /
        the name of the authenticated user
    policies / list of dicts /
        A list of policies to check against the cluster and indices

    Returns: a list of policies that apply to the given user

    """
    user_available_policies = []
    for policy in policies:
        if '*' in policy['users']:
            user_available_policies.append(policy)
        elif user in policy['users']:
            user_available_policies.append(policy)

    return user_available_policies