# GAS Library - OwnershipTransfer

## Overview

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.

## Description

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.

## Limitation

• Owner of the root folder of Google Drive cannot be transferred.
• When the owner of the files and folders is transferred, sendNotificationEmail cannot be false. Ref
• 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

1khX5L_Q0GV8uh2r8-0dj4SA-K3ONOic_lciQrxIE8qVKjRUfpctB15jz


You can see the detail information here https://github.com/tanaikech/OwnershipTransfer