David
David

Reputation: 799

Preventing default "Editors will be allowed to add people and change the permissions" behaviour when sharing a file on Google Drive via API

My application requires that a subset of users have the ability to edit Google documents that have been shared with them and owned by someone else, however the documents access should not be managed by these users, they should only have edit access.

It appears that the default setting is that editors can manage the shared file access, but that this can be prevented by setting the files share setting explicitly to "Only the owner can change the permissions" in the UI.

The issue is that I'm managing these files with the Google Drive SDK and I don't see any way of changing this setting via the SDK. Is this possible?

Upvotes: 3

Views: 1027

Answers (1)

David
David

Reputation: 799

I will answer my own question in the event someone also is looking for this answer. You can disable the ability of writers having the ability to share the file by setting the flag writersCanShare on the File object using the method file.setWritersCanShare(false).

I assumed that this would have been part of the permissions, anyways it was as simple as that.

Upvotes: 5

Related Questions