'Create, read, or update enrollment information for a user.
HTTP Endpoint for all CRUD operations for a user course enrollment. Allows creation, reading, and
updates of the current enrollment for a particular course.
Args:
request (Request): The HTTP GET request
username (str): Fetch the list of providers linked to this user
Return:
JSON serialized list of the providers linked to this user.'

def get(self, request, username):

    if (request.user.username != username):
        if ((not request.user.is_superuser) and (not ApiKeyHeaderPermission().has_permission(request, self))):
            return Response(status=status.HTTP_403_FORBIDDEN)
    try:
        user = User.objects.get(username=username)
    except User.DoesNotExist:
        return Response(status=status.HTTP_404_NOT_FOUND)
    providers = pipeline.get_provider_user_states(user)
    active_providers = [{'provider_id': assoc.provider.provider_id, 'name': assoc.provider.name, 'remote_id': assoc.remote_id} for assoc in providers if assoc.has_account]
    return Response({'active': active_providers})
