0

我正在使用 Google Drive 来共享我的文件,例如 pdf 或 word。我想授予共享者仅查看该文件而不是下载的权限。从谷歌驱动器界面我可以设置该权限,但如何以编程方式设置它。我正在使用 PHP 进行开发。

4

1 回答 1

0

使用permissions.create 向用户、组或域授予其他权限。

虽然不完全相关,但这篇SO 帖子演示了如何使用 PHP 为文件创建权限:

//Give everyone permission to read and write the file
$permission = new Google_Permission();
$permission->setRole( 'writer' );
$permission->setType( 'anyone' );
$permission->setValue( 'me' );
$service->permissions->insert( $file->getId(), $permission );
于 2018-07-26T07:21:29.550 回答