0

I've noticed the doclist api has become deprecated and I'm trying to transfer shared files from 1 user to another.

In Doclist(depricated): https://developers.google.com/google-apps/documents-list/#using_google_apps_administrative_access_to_impersonate_other_domain_users

Example :

Employee A: Stopped working at the company.

Employee B: New owner of Employee A's files.

Employee C:Admin

I know the admin(User C) has a menu where he can transfer the ownership of the files from user A to user B. But this does not transfer the files that used to be shared with user A.

I would like to make an application wich transfers the files shared with user A and shares them to user C. This has to be done by the admin(user C).

I already know how to transfer the ownership if user A is logged on. But in most cases this is not possible.

*I would like to know if there's a way to get the files shared with user A to be shared with user B without authenticating user A?*

DavidVdd
  • 1,020
  • 3
  • 17
  • 40

1 Answers1

1

If files are shared with User A, it should be the owner or other editors that share the file with user B again. If user A is only reader on a file, user A can't re-share the file. Also if the owner of the file set the sharing permissions not to allow editors to share the file again, user A could not share the file.

The best way to resolve this would be by procedure:

  • If the files are shared using folders or groups, swap out user A for user B
  • If you can logon as user A, run a script to create a listing of all documents shared with A and share this listing with B and have B request access to the documents from the document owners.

The technical option to do this, which is quite nasty, is to write some code (i.e. in Java) that:

Community
  • 1
  • 1
  • Its related to authentication I guess. When I log in I can use my code to transfer all my files and shares to another user. But I don't know how to do this for other user wich I wan't to impersonate. I'll have to ask to make a service account in the domain and use that to acces the drive? – DavidVdd Oct 16 '12 at 14:52
  • that would require some coding. Through code, get a file you'd want to re-share, and using the API and above mentioned permissions api call update the sharing of the document. This is not 'a couple of lines of code' but is some serious programming. If this is incidental, consider introducing the procedure where user B asks for permission on the shared documents. – Stefan Hogendoorn Oct 16 '12 at 14:57
  • I can transfer the files and shares but only from myself to another person. Oops I didn't read :impersonate every owner to reshare the file with the user ... Jup forgot that, this wil indeed take some time. :( – DavidVdd Oct 16 '12 at 15:08
  • I was able to reshare a file from another owner to another user, but this is probably because it was a read/write file – DavidVdd Oct 16 '12 at 15:14
  • Once you use a service account, changing the person you impersonate should not be such an issue. Another thing you could do: Identify the document owners of documents you can't reshare and using email ask them to share a specific document with user B. – Stefan Hogendoorn Oct 16 '12 at 15:54
  • Hmmm It works now but I added the service account in the Manage API client access I don't know if this is allowed! – DavidVdd Oct 17 '12 at 06:49
  • How can I get the email adress of the owner I need this to impersonate him. – DavidVdd Oct 18 '12 at 12:29
  • 'Translate' the username you get from the Drive API to an email address by using the profile API to find the user by username and from that get the email address. Messy but for now the only way round I guess. I find it odd Google is not providing the userid == email address to us anymore. They used to in the old DocsList api. – Stefan Hogendoorn Oct 18 '12 at 13:03