google drive sdk - Transfer ownership with Java client -


i using java client of google drive sdk.

application goal: transfer ownership of files parent owner. this, mean there number of accounts large storage amounts eg. storageacct1, storageacct2, etc. if user moves files account, still retain ownership , incur storage penalty. application run in background , transfer ownership storage accounts.

i have created drive service object storageacct1 , authenticated domain. can authenticate storageacct1 , list files add/remove writer , viewer permissions. however, cannot transfer ownership. this, if appsuser1 owns document1, storageacct1 cannot obtain ownership if account set super admin or drive admin.

i have noticed if create new service object owner can transfer ownership. (create service account appsuser1@domain.com transfer ownership of document1 storageacct1).

since permissions api calls not return owner's emails , names, cannot programatically go through list of files , transfer ownership. prefer not have add in database lookup name vs email , tie in provisioning api.

thank suggestions.

it's impossible transfer ownership if new owner on different domain existing one, otherwise should able modify owner.

if have list of users on different domains , know user's domain match domain's service account, make request userinfo retrieve his/her domain:

get https://www.googleapis.com/oauth2/v2/userinfo {   "email": "email@domain.com",   "hd": "domain.com" } 

you still need match domain service account though.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -