我使用JavaScript通过以下代码获取共享文件夹的权限:
gapi.client.drive.permissions.list({
'fileId': fileID,
'fields': '*'
});
返回
{
"kind": "drive#permission",
"id": "121212321331323321313",
"type": "user",
"emailAddress": "bar.foo@gmail.com",
"role": "reader",
"displayName": "Foo Bar",
"deleted": false,
"expirationTime": "2018-03-23T02:59:59.000Z",
},
我的问题是: 我与gmail域共享我的文件夹。 Google向受众发送邀请,然后需要登录G Suite帐户才能共享,一旦发生,另一个用户就会添加权限列表。 MouseHover显示此信息时此用户:
Google Drive permissions Resource
有没有办法获取这些信息(邀请为)? (最好通过API)
答案 0 :(得分:0)
不幸的是,此时数据不可用。即使执行permissions .get返回完整的permission resource也不包含该信息。
{
"kind": "drive#permission",
"id": string,
"type": string,
"emailAddress": string,
"domain": string,
"role": string,
"allowFileDiscovery": boolean,
"displayName": string,
"photoLink": string,
"expirationTime": datetime,
"teamDrivePermissionDetails": [
{
"teamDrivePermissionType": string,
"role": string,
"inheritedFrom": string,
"inherited": boolean
}
],
"deleted": boolean
}
您可能需要考虑将其添加为功能请求。 issue tracker