1
votes

Use case: * Created a shared drive "Demo_Folder" * For "User A" - gave Content manager access. For "User B" - gave Viewer access. * Uploaded 3 files (file1.sv, file2.csv and file3.csv) to Demo_Folder * For file3.csv, I would like to provide editor access to "User B". I was able to do this via UI. However, I am not able to do this using API.

Here is the code:

permission = {u'role':u'writer'} service.permissions().update(fileId=file_id,supportsAllDrives=True,permissionId=permission_id, body=permission).execute()

Error: googleapiclient.errors.HttpError: https://www.googleapis.com/drive/v3/files/<***********>/permissions/<********>?alt=json&supportsAllDrives=true returned "Cannot update or delete an inherited permission on a shared drive item.">

1

1 Answers

0
votes

It's not possible to achieve this granular permission update for files inside a Shared Drives. You can only update the permission for the entire Shared Drive folder using its ID in the fileId field.

File a Feature Request

Feel free to request this new feature here: https://issuetracker.google.com/issues/new?component=191650&template=824106