This is a Google Apps Script library for achieving the ownership-transfer of the specific folder including the files and sub-folders using Drive API.
IMPORTANT: PLEASE BE CAREFUL THIS.
At first, please read this section
I cannot take responsibility for the problems occurred by this library. So when you use this library, please use it by according to your own decision and at your own responsibility.
This GAS library transfers the ownership of files and folders. For example, when the ownership of a file is transferred to other account, the file cannot be managed by the original user. And also, when the ownership of the specific folder is transferred to other account, all files ans sub-folders in the specific folder cannot be managed by the original user. PLEASE BE CAREFUL THIS. So when you use this library, at first, please test this library using a sample file and folder. PLEASE BE CAREFUL THIS.
And also, the specification of ownership transfer might be updated by Google side in the future update. Because when I had tested this library, I could notice that the specification had been changed. Ref By this, I noticed that the transferred files had no parent folders, and also, the script was required to be modified. From this situation, when you use this script for your important files and folders, please be careful this. At first, PLEASE TEST THIS LIBRARY USING A SIMPLE FILE AND FOLDER.
Recently, I had the situation that it is required to transfer the ownership of a folder including the files and sub-folders. When I manually transferred the ownership of the top folder from my account to other user’s account, although the ownership of top folder could be transferred, my account is left as the writer. And also, the ownership of the files and sub-folders in the top folder was not changed, while the user is the writer. Although I do the same situation using the method of create.permissions in Drive API, the same result was obtained. In the current stage, unfortunately, by the simple method, the complete ownership-transfer of the file including the files and sub-folders cannot be achieved. From this situation, I created the script for achieving the complete ownership-transfer of the files and folders as a Google Apps Script library.
- Owner of the root folder of Google Drive cannot be transferred.
- When the owner of the files and folders is transferred,
- When the ownership of a lot of files and folders is transferred, after the script was finished, please wait for completely reflecting the transfer ownership. Please be careful this.
- The ownership of files and folders, that you are not the owner, cannot be transferred.
- When the ownership of the files and folders with other users are included as the writer and viewer is transferred, their permissions are kept even when the owner is changed.
- In the current stage, this library cannot be used for the shared Drive.
I sincerely hope this library is useful for you.
Library’s project key
You can see the detail information here https://github.com/tanaikech/OwnershipTransfer