2

I'm starting with the Google APIs Client Library for Python. I'm developing with the Drive API. I'm migrating my web application from the deprecated Document List API v3 to Drive API V2.

When I add some permissions on a document via BatchHttpRequest, only one of these permissions is effectively added to the document. The others are ignored.

Below a sample code:

def callback(request_id, response, exception):
    if exception is not None:
        logger.debug(exception)
    else:
        logger.debug(response)

batch = BatchHttpRequest(callback)  # from apiclient.http
batch.add(drive_client.permissions().insert(body=permission_1))
batch.add(drive_client.permissions().insert(body=permission_2))
...
batch.add(drive_client.permissions().insert(body=permission_n))
batch.execute()

Only user permissions are added. The default entry ("anyone") is ignored. Response is always logged, so everything seems to run fine.

If I execute each call separately, all the permissions are added.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
arnaud.breton
  • 2,054
  • 1
  • 24
  • 39
  • I submitted your problem as a bug to the google-api-python-client project since I'm having the same issue. https://code.google.com/p/google-api-python-client/issues/detail?id=260 – pmdarrow Apr 17 '13 at 14:57
  • Can't reproduce with https://gist.github.com/burcu/5405375 Btw, your sample is missing a fileId parameter, it may be misleading. – Burcu Dogan Apr 17 '13 at 15:47

0 Answers0