I'm using the google drive php api to change permissions of a file. It works when I set the "role" to "writer", but when I set the "role" to "owner", as such:
$batch = $driveService->createBatch();
$userPermission = new Google_Service_Drive_Permission(array(
'type' => 'user',
'role' => 'owner',
'transferOwnership' => 'true',
'emailAddress' => 'c*****@c*******.org'
));
$request = $driveService->permissions->create(
$fileId, $userPermission, array('fields' => 'id'));
$batch->add($request, 'user2');
$results = $batch->execute();
I get an error that "transferOwnership" must be set to true. But, it seems like I have already set transferOwnership to true! What am I doing wrong?
exception 'Google_Service_Exception' with message '{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "The transferOwnership parameter must be enabled when the permission role is 'owner'.",
"locationType": "parameter",
"location": "transferOwnership"
}
],
"code": 403,
"message": "The transferOwnership parameter must be enabled when the permission role is 'owner'."
}