是否可以获取文件请求中的权限列表

时间:2012-09-19 21:02:35

标签: google-drive-api

我正在显示google驱动器根目录中的文件夹列表,我希望在与其他人共享文件夹时显示图标,无论与谁共享。

是否可以在file.list请求中获取该信息?或者我必须为每个文件夹发出新请求以获取权限列表?

在google docs api中,有一个包含此信息的类别标记。

此致 阿尔瓦罗。

1 个答案:

答案 0 :(得分:-1)

使用file.list请求时,返回的响应正文将包含以下内容:

    {
       "kind": "drive#fileList",
        "etag": etag,
        "selfLink": string,
        "nextPageToken": string,
        "nextLink": string,
        "items": [files Resource]
    }

然后在[files Resource]中,结构如下:

 {
   "kind": "drive#file",
   "id": string,
   "etag": etag,
   "selfLink": string,
   "webContentLink": string,
   "alternateLink": string,
   "embedLink": string,
   "thumbnailLink": string,
   "title": string,
   "mimeType": string,
   "description": string,
   "labels": {
   "starred": boolean,
   "hidden": boolean,
   "trashed": boolean,
   "restricted": boolean,
   "viewed": boolean
    },
  "createdDate": datetime,
  "modifiedDate": datetime,
  "modifiedByMeDate": datetime,
  "lastViewedByMeDate": datetime,
  "sharedWithMeDate": datetime,
  "parents": [
           parents Resource
     ],
  "downloadUrl": string,
  "exportLinks": {
  (key): string
    },
  "indexableText": {
  "text": string
    },
  "userPermission": permissions Resource,
  "originalFilename": string,
  "fileExtension": string,
  "md5Checksum": string,
  "fileSize": long,
  "quotaBytesUsed": long,
  "ownerNames": [
        string
   ],
  "lastModifyingUserName": string,
  "editable": boolean,
  "writersCanShare": boolean,
  "explicitlyTrashed": boolean,
  "imageMediaMetadata": {
      "width": integer,
      "height": integer,
      "rotation": integer,
   "location": {
       "latitude": double,
       "longitude": double,
       "altitude": double
      }
    }
 }

字段“userPermission”是您可以找到答案的字段。