Friday, 15 August 2014

javascript - Trying to change owner on files in Google Drive -



javascript - Trying to change owner on files in Google Drive -

i'm trying alter ownership of documents in drive, recieve next error:

we're sorry, server error occurred. please wait bit , seek again. (line 12, file "code")

function transferfiles() { var files = driveapp.getfiles(); while (files.hasnext()) { var file = files.next(); var owner = file.getowner().getemail(); if (owner != 'adminuser@domain.co.uk'){ file.setowner('adminuser@domain.co.uk'); } logger.log(file); } }

you've described reported issue. see & star issue 2756: server error illegal acl change

summary: owner of file can alter ownership. admin accounts don't own user's files, have no special privileges in respect.

a possible work-around utilizing drive api (not google apps script) impersonate domain users described in this answer, unfortunately without implementation details.

javascript google-apps-script

No comments:

Post a Comment