I'm trying to set public permissions to a google cloud storage object that I have uploaded.
The upload happens via a go application that runs on Google App Engine, using the google.golang.org/api/storage/v1
package.
From the same code, I am able to create and delete any object, however trying to set public read fails with the following error:
googleapi: Error 403: Insufficient Permission, insufficientPermissions
This is my code:
if _, err := service.ObjectAccessControls.Update(bucketNameDone, object, "allUsers", &storage.ObjectAccessControl{Role: "READER", Object: object}).Do(); err != nil {
log.Errorf(ctx, "failed to set public perms for %s: %v", object, err)
}
The docs for this suck pretty badly so I can't figure out what I am missing. Any ideas?