Im developing a software that will use google drive and google docs. Recently I discovered that there is an option in google drive sharing menu: prevent others from sharing a document. I wanted to implement this in my application using Go language, but with no lack.
The problem is, I do an Insert file call (using google drive api) with WritersCanShare field set to false, but still users with writer role can share a file. Here is the code block:
file, err = srv.Files.Insert(&drive.File{
CreatedDate: time.Now().Format(time.RFC3339),
MimeType: "application/vnd.google-apps.document",
Title: "sometitle",
WritersCanShare: false,
}).Do()
So, what can I do to solve the issue ?
I use service account to create files and give owner role to my main google account.