blob: 3ce72a441aec99d7b5c6a70af67f24eabdbd4a25 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="drive_v2.html">Drive API</a> . <a href="drive_v2.permissions.html">permissions</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
79<p class="firstline">Deletes a permission from a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040080<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070081 <code><a href="#get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040082<p class="firstline">Gets a permission by ID.</p>
83<p class="toc_element">
84 <code><a href="#getIdForEmail">getIdForEmail(email)</a></code></p>
85<p class="firstline">Returns the permission ID for an email address.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#insert">insert(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, sendNotificationEmails=None, emailMessage=None, useDomainAdminAccess=None)</a></code></p>
88<p class="firstline">Inserts a permission for a file or shared drive.</p>
John Asmuth614db982014-04-24 15:46:26 -040089<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 <code><a href="#list">list(fileId, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, maxResults=None)</a></code></p>
91<p class="firstline">Lists a file's or shared drive's permissions.</p>
John Asmuth614db982014-04-24 15:46:26 -040092<p class="toc_element">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -040093 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
94<p class="firstline">Retrieves the next page of results.</p>
95<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070096 <code><a href="#patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</a></code></p>
Takashi Matsuo06694102015-09-11 13:55:40 -070097<p class="firstline">Updates a permission using patch semantics.</p>
John Asmuth614db982014-04-24 15:46:26 -040098<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070099 <code><a href="#update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -0400100<p class="firstline">Updates a permission.</p>
101<h3>Method Details</h3>
102<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103 <code class="details" id="delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
104 <pre>Deletes a permission from a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400105
106Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700107 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400108 permissionId: string, The ID for the permission. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
110 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
111 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400112</pre>
113</div>
114
115<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700116 <code class="details" id="get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400117 <pre>Gets a permission by ID.
118
119Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400121 permissionId: string, The ID for the permission. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700122 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
123 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
124 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400125
126Returns:
127 An object of the form:
128
129 { # A permission for a file.
130 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700131 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700132 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400133 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400134 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
135 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700136 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400137 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700138 # - reader
139 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
140 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
141 # - file
142 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400143 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
144 "A String",
145 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400146 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
147 },
148 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 "name": "A String", # The name for this permission.
150 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
151 {
152 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
153 "role": "A String", # Deprecated - use permissionDetails/role instead.
154 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
155 "A String",
156 ],
157 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
158 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
159 },
160 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400161 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400162 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800163 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
164 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700165 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400166 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800167 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400168 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
169 # - They can only be set on user and group permissions
170 # - The date must be in the future
171 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700172 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400173 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400174 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175 # - organizer
176 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400177 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700178 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400179 "type": "A String", # The account type. Allowed values are:
180 # - user
181 # - group
182 # - domain
183 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400184 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400185 "A String",
186 ],
187 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700188 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400189 }</pre>
190</div>
191
192<div class="method">
193 <code class="details" id="getIdForEmail">getIdForEmail(email)</code>
194 <pre>Returns the permission ID for an email address.
195
196Args:
197 email: string, The email address for which to return a permission ID (required)
198
199Returns:
200 An object of the form:
201
202 { # An ID for a user or group as seen in Permission items.
203 "kind": "drive#permissionId", # This is always drive#permissionId.
204 "id": "A String", # The permission ID.
205 }</pre>
206</div>
207
208<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700209 <code class="details" id="insert">insert(fileId, body, supportsTeamDrives=None, supportsAllDrives=None, sendNotificationEmails=None, emailMessage=None, useDomainAdminAccess=None)</code>
210 <pre>Inserts a permission for a file or shared drive.
John Asmuth614db982014-04-24 15:46:26 -0400211
212Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700213 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400214 body: object, The request body. (required)
215 The object takes the form of:
216
217{ # A permission for a file.
218 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700219 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700220 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400221 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400222 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
223 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700224 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400225 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700226 # - reader
227 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
228 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
229 # - file
230 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400231 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
232 "A String",
233 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400234 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
235 },
236 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700237 "name": "A String", # The name for this permission.
238 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
239 {
240 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
241 "role": "A String", # Deprecated - use permissionDetails/role instead.
242 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
243 "A String",
244 ],
245 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
246 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
247 },
248 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400249 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400250 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800251 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
252 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700253 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400254 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800255 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400256 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
257 # - They can only be set on user and group permissions
258 # - The date must be in the future
259 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400261 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400262 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700263 # - organizer
264 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400265 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700266 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400267 "type": "A String", # The account type. Allowed values are:
268 # - user
269 # - group
270 # - domain
271 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400272 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400273 "A String",
274 ],
275 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700276 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400277}
278
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700279 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
280 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
Craig Citro065b5302014-08-14 00:47:23 -0700281 sendNotificationEmails: boolean, Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700282 emailMessage: string, A plain text custom message to include in notification emails.
283 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
John Asmuth614db982014-04-24 15:46:26 -0400284
285Returns:
286 An object of the form:
287
288 { # A permission for a file.
289 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700290 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700291 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400292 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400293 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
294 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700295 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400296 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700297 # - reader
298 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
299 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
300 # - file
301 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400302 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
303 "A String",
304 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400305 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
306 },
307 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700308 "name": "A String", # The name for this permission.
309 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
310 {
311 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
312 "role": "A String", # Deprecated - use permissionDetails/role instead.
313 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
314 "A String",
315 ],
316 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
317 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
318 },
319 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400320 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400321 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800322 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
323 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700324 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400325 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800326 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400327 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
328 # - They can only be set on user and group permissions
329 # - The date must be in the future
330 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700331 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400332 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400333 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700334 # - organizer
335 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400336 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700337 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400338 "type": "A String", # The account type. Allowed values are:
339 # - user
340 # - group
341 # - domain
342 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400343 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400344 "A String",
345 ],
346 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700347 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400348 }</pre>
349</div>
350
351<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700352 <code class="details" id="list">list(fileId, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, maxResults=None)</code>
353 <pre>Lists a file's or shared drive's permissions.
John Asmuth614db982014-04-24 15:46:26 -0400354
355Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700356 fileId: string, The ID for the file or shared drive. (required)
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400357 pageToken: string, The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700358 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
359 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
360 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
361 maxResults: integer, The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned.
John Asmuth614db982014-04-24 15:46:26 -0400362
363Returns:
364 An object of the form:
365
366 { # A list of permissions associated with a file.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400367 "nextPageToken": "A String", # The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results.
368 "items": [ # The list of permissions.
John Asmuth614db982014-04-24 15:46:26 -0400369 { # A permission for a file.
370 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700371 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700372 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400373 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400374 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
375 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700376 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400377 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700378 # - reader
379 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
380 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
381 # - file
382 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400383 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
384 "A String",
385 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400386 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
387 },
388 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700389 "name": "A String", # The name for this permission.
390 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
391 {
392 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
393 "role": "A String", # Deprecated - use permissionDetails/role instead.
394 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
395 "A String",
396 ],
397 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
398 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
399 },
400 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400401 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400402 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800403 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
404 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700405 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400406 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800407 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400408 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
409 # - They can only be set on user and group permissions
410 # - The date must be in the future
411 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700412 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400413 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400414 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700415 # - organizer
416 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400417 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700418 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400419 "type": "A String", # The account type. Allowed values are:
420 # - user
421 # - group
422 # - domain
423 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400424 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400425 "A String",
426 ],
427 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700428 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400429 },
430 ],
431 "kind": "drive#permissionList", # This is always drive#permissionList.
432 "etag": "A String", # The ETag of the list.
433 "selfLink": "A String", # A link back to this list.
434 }</pre>
435</div>
436
437<div class="method">
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400438 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
439 <pre>Retrieves the next page of results.
440
441Args:
442 previous_request: The request for the previous page. (required)
443 previous_response: The response from the request for the previous page. (required)
444
445Returns:
446 A request object that you can call 'execute()' on to request the next
447 page. Returns None if there are no more items in the collection.
448 </pre>
449</div>
450
451<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700452 <code class="details" id="patch">patch(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
Takashi Matsuo06694102015-09-11 13:55:40 -0700453 <pre>Updates a permission using patch semantics.
John Asmuth614db982014-04-24 15:46:26 -0400454
455Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700456 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400457 permissionId: string, The ID for the permission. (required)
458 body: object, The request body. (required)
459 The object takes the form of:
460
461{ # A permission for a file.
462 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700463 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700464 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400465 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400466 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
467 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700468 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400469 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700470 # - reader
471 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
472 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
473 # - file
474 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400475 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
476 "A String",
477 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400478 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
479 },
480 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700481 "name": "A String", # The name for this permission.
482 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
483 {
484 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
485 "role": "A String", # Deprecated - use permissionDetails/role instead.
486 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
487 "A String",
488 ],
489 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
490 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
491 },
492 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400493 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400494 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800495 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
496 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700497 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400498 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800499 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400500 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
501 # - They can only be set on user and group permissions
502 # - The date must be in the future
503 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700504 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400505 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400506 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700507 # - organizer
508 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400509 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700510 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400511 "type": "A String", # The account type. Allowed values are:
512 # - user
513 # - group
514 # - domain
515 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400516 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400517 "A String",
518 ],
519 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700520 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400521}
522
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700523 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700524 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
525 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
526 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000527 transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
John Asmuth614db982014-04-24 15:46:26 -0400528
529Returns:
530 An object of the form:
531
532 { # A permission for a file.
533 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700534 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700535 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400536 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400537 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
538 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700539 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400540 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700541 # - reader
542 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
543 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
544 # - file
545 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400546 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
547 "A String",
548 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400549 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
550 },
551 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700552 "name": "A String", # The name for this permission.
553 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
554 {
555 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
556 "role": "A String", # Deprecated - use permissionDetails/role instead.
557 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
558 "A String",
559 ],
560 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
561 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
562 },
563 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400564 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400565 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800566 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
567 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700568 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400569 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800570 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400571 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
572 # - They can only be set on user and group permissions
573 # - The date must be in the future
574 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700575 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400576 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400577 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700578 # - organizer
579 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400580 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700581 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400582 "type": "A String", # The account type. Allowed values are:
583 # - user
584 # - group
585 # - domain
586 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400587 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400588 "A String",
589 ],
590 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700591 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400592 }</pre>
593</div>
594
595<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700596 <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400597 <pre>Updates a permission.
598
599Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700600 fileId: string, The ID for the file or shared drive. (required)
John Asmuth614db982014-04-24 15:46:26 -0400601 permissionId: string, The ID for the permission. (required)
602 body: object, The request body. (required)
603 The object takes the form of:
604
605{ # A permission for a file.
606 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700607 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700608 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400609 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400610 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
611 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700612 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400613 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700614 # - reader
615 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
616 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
617 # - file
618 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400619 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
620 "A String",
621 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400622 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
623 },
624 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700625 "name": "A String", # The name for this permission.
626 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
627 {
628 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
629 "role": "A String", # Deprecated - use permissionDetails/role instead.
630 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
631 "A String",
632 ],
633 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
634 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
635 },
636 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400637 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400638 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800639 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
640 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700641 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400642 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800643 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400644 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
645 # - They can only be set on user and group permissions
646 # - The date must be in the future
647 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700648 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400649 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400650 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700651 # - organizer
652 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400653 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700654 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400655 "type": "A String", # The account type. Allowed values are:
656 # - user
657 # - group
658 # - domain
659 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400660 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400661 "A String",
662 ],
663 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700664 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400665}
666
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700667 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700668 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
669 supportsAllDrives: boolean, Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives.
670 useDomainAdminAccess: boolean, Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000671 transferOwnership: boolean, Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.
John Asmuth614db982014-04-24 15:46:26 -0400672
673Returns:
674 An object of the form:
675
676 { # A permission for a file.
677 "withLink": True or False, # Whether the link is required for this permission.
Craig Citro065b5302014-08-14 00:47:23 -0700678 "domain": "A String", # The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700679 "permissionDetails": [ # Details of whether the permissions on this shared drive item are inherited or directly on this item. This is an output-only field which is present only for shared drive items.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400680 {
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400681 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
682 # - organizer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700683 # - fileOrganizer
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400684 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700685 # - reader
686 "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the shared drive.
687 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
688 # - file
689 # - member
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400690 "additionalRoles": [ # Additional roles for this user. Only commenter is currently possible, though more may be supported in the future.
691 "A String",
692 ],
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400693 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
694 },
695 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700696 "name": "A String", # The name for this permission.
697 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
698 {
699 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
700 "role": "A String", # Deprecated - use permissionDetails/role instead.
701 "additionalRoles": [ # Deprecated - use permissionDetails/additionalRoles instead.
702 "A String",
703 ],
704 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
705 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
706 },
707 ],
Sai Cheemalapati4ba8c232017-06-06 18:46:08 -0400708 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
John Asmuth614db982014-04-24 15:46:26 -0400709 "kind": "drive#permission", # This is always drive#permission.
Jon Wayne Parrott692617a2017-01-06 09:58:29 -0800710 "value": "A String", # The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
711 "id": "A String", # The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700712 "authKey": "A String", # Deprecated.
John Asmuth614db982014-04-24 15:46:26 -0400713 "etag": "A String", # The ETag of the permission.
Craig Citroe633be12015-03-02 13:40:36 -0800714 "emailAddress": "A String", # The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group.
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400715 "expirationDate": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
716 # - They can only be set on user and group permissions
717 # - The date must be in the future
718 # - The date cannot be more than a year in the future
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700719 # - The date can only be set on drive.permissions.update or drive.permissions.patch requests
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400720 "role": "A String", # The primary role for this user. While new values may be supported in the future, the following are currently allowed:
John Asmuth614db982014-04-24 15:46:26 -0400721 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700722 # - organizer
723 # - fileOrganizer
John Asmuth614db982014-04-24 15:46:26 -0400724 # - writer
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700725 # - reader
John Asmuth614db982014-04-24 15:46:26 -0400726 "type": "A String", # The account type. Allowed values are:
727 # - user
728 # - group
729 # - domain
730 # - anyone
Sai Cheemalapatic30d2b52017-03-13 12:12:03 -0400731 "additionalRoles": [ # Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future.
John Asmuth614db982014-04-24 15:46:26 -0400732 "A String",
733 ],
734 "selfLink": "A String", # A link back to this permission.
Sai Cheemalapatidf613972016-10-21 13:59:49 -0700735 "photoLink": "A String", # A link to the profile photo, if available.
John Asmuth614db982014-04-24 15:46:26 -0400736 }</pre>
737</div>
738
739</body></html>