whitesiroi
whitesiroi

Reputation: 2853

"Action not allowed" error on file.setOwner Apps Script (Google Drive API)

Getting error message "Action not allowed (line 3, file "Code")"

function myFunction() {
  var file = DriveApp.getFileById("0Bz99xGttsifZR2ItTU5pdXXXXX");
  file.setOwner("[email protected]");
}

I'm the owner of the file, so I don't know why it's not allowed.

Upvotes: 0

Views: 2272

Answers (2)

Kriggs
Kriggs

Reputation: 3778

You can transfer to anyone, but only Google Drive extensions, ie. the files that doesn't take space in Drive.

Upvotes: 2

ScampMichael
ScampMichael

Reputation: 3728

Transfer ownership is only possible within a domain. If it were allowed you could fill up the drive of someone in another domain with garbage, resulting in a small Denial of Service attack on that user.

Upvotes: 2

Related Questions