'REST API endpoint for listing all the blocks information in the course,
while regarding user access and roles.
Arguments:
request - Django request object
usage_key_string - The usage key for a block.'

def list(self, request, usage_key_string):

    requested_params = request.query_params.copy()
    requested_params.update({'usage_key': usage_key_string})
    params = BlockListGetForm(requested_params, initial={'requesting_user': request.user})
    if (not params.is_valid()):
        raise ValidationError(params.errors)
    try:
        return Response(get_blocks(request, params.cleaned_data['usage_key'], params.cleaned_data['user'], params.cleaned_data['depth'], params.cleaned_data.get('nav_depth'), params.cleaned_data['requested_fields'], params.cleaned_data.get('block_counts', []), params.cleaned_data.get('student_view_data', []), params.cleaned_data['return_type'], params.cleaned_data.get('block_types_filter', None)))
    except ItemNotFoundError as exception:
        raise Http404('Block    not    found:    {}'.format(exception.message))
