blob: 5caebe3b453edd4114f5acd4801592d3b700dfb5 [file] [log] [blame]
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -08001<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_v3.html">Drive API</a> . <a href="drive_v3.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="#create">create(fileId, body, sendNotificationEmail=None, supportsTeamDrives=None, supportsAllDrives=None, transferOwnership=None, emailMessage=None, useDomainAdminAccess=None)</a></code></p>
79<p class="firstline">Creates a permission for a file or shared drive.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080080<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070081 <code><a href="#delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080082<p class="firstline">Deletes a permission.</p>
83<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070084 <code><a href="#get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080085<p class="firstline">Gets a permission by ID.</p>
86<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#list">list(fileId, pageSize=None, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</a></code></p>
88<p class="firstline">Lists a file's or shared drive's permissions.</p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080089<p class="toc_element">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93 <code><a href="#update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</a></code></p>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080094<p class="firstline">Updates a permission with patch semantics.</p>
95<h3>Method Details</h3>
96<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097 <code class="details" id="create">create(fileId, body, sendNotificationEmail=None, supportsTeamDrives=None, supportsAllDrives=None, transferOwnership=None, emailMessage=None, useDomainAdminAccess=None)</code>
98 <pre>Creates a permission for a file or shared drive.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -080099
100Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700101 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800102 body: object, The request body. (required)
103 The object takes the form of:
104
105{ # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
106 "domain": "A String", # The domain to which this permission refers.
107 "displayName": "A String", # A displayable name for users, groups or domains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700108 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
109 {
110 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
111 "role": "A String", # Deprecated - use permissionDetails/role instead.
112 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
113 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
114 },
115 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800116 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700117 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700118 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800119 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
120 "photoLink": "A String", # A link to the user's profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700121 "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.
122 {
123 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
124 # - organizer
125 # - fileOrganizer
126 # - writer
127 # - commenter
128 # - reader
129 "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.
130 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
131 # - file
132 # - member
133 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
134 },
135 ],
136 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
137 # - They can only be set on user and group permissions
138 # - The time must be in the future
139 # - The time cannot be more than a year in the future
140 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800141 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700142 # - organizer
143 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800144 # - writer
145 # - commenter
146 # - reader
147 "type": "A String", # The type of the grantee. Valid values are:
148 # - user
149 # - group
150 # - domain
151 # - anyone
152 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
153}
154
155 sendNotificationEmail: boolean, Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700156 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
157 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800158 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700159 emailMessage: string, A plain text custom message to include in the notification email.
160 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800161
162Returns:
163 An object of the form:
164
165 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
166 "domain": "A String", # The domain to which this permission refers.
167 "displayName": "A String", # A displayable name for users, groups or domains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700168 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
169 {
170 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
171 "role": "A String", # Deprecated - use permissionDetails/role instead.
172 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
173 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
174 },
175 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800176 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700177 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700178 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800179 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
180 "photoLink": "A String", # A link to the user's profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700181 "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.
182 {
183 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
184 # - organizer
185 # - fileOrganizer
186 # - writer
187 # - commenter
188 # - reader
189 "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.
190 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
191 # - file
192 # - member
193 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
194 },
195 ],
196 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
197 # - They can only be set on user and group permissions
198 # - The time must be in the future
199 # - The time cannot be more than a year in the future
200 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800201 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700202 # - organizer
203 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800204 # - writer
205 # - commenter
206 # - reader
207 "type": "A String", # The type of the grantee. Valid values are:
208 # - user
209 # - group
210 # - domain
211 # - anyone
212 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
213 }</pre>
214</div>
215
216<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700217 <code class="details" id="delete">delete(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800218 <pre>Deletes a permission.
219
220Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700221 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800222 permissionId: string, The ID of the permission. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700223 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
224 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.
225 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800226</pre>
227</div>
228
229<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700230 <code class="details" id="get">get(fileId, permissionId, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800231 <pre>Gets a permission by ID.
232
233Args:
234 fileId: string, The ID of the file. (required)
235 permissionId: string, The ID of the permission. (required)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700236 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
237 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.
238 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800239
240Returns:
241 An object of the form:
242
243 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
244 "domain": "A String", # The domain to which this permission refers.
245 "displayName": "A String", # A displayable name for users, groups or domains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700246 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
247 {
248 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
249 "role": "A String", # Deprecated - use permissionDetails/role instead.
250 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
251 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
252 },
253 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800254 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700255 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700256 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800257 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
258 "photoLink": "A String", # A link to the user's profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700259 "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.
260 {
261 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
262 # - organizer
263 # - fileOrganizer
264 # - writer
265 # - commenter
266 # - reader
267 "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.
268 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
269 # - file
270 # - member
271 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
272 },
273 ],
274 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
275 # - They can only be set on user and group permissions
276 # - The time must be in the future
277 # - The time cannot be more than a year in the future
278 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800279 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700280 # - organizer
281 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800282 # - writer
283 # - commenter
284 # - reader
285 "type": "A String", # The type of the grantee. Valid values are:
286 # - user
287 # - group
288 # - domain
289 # - anyone
290 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
291 }</pre>
292</div>
293
294<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700295 <code class="details" id="list">list(fileId, pageSize=None, pageToken=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None)</code>
296 <pre>Lists a file's or shared drive's permissions.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800297
298Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700299 fileId: string, The ID of the file or shared drive. (required)
300 pageSize: 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.
301 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.
302 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
303 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.
304 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800305
306Returns:
307 An object of the form:
308
309 { # A list of permissions for a file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700310 "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.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700311 "kind": "drive#permissionList", # Identifies what kind of resource this is. Value: the fixed string "drive#permissionList".
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700312 "permissions": [ # The list of permissions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800313 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
314 "domain": "A String", # The domain to which this permission refers.
315 "displayName": "A String", # A displayable name for users, groups or domains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700316 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
317 {
318 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
319 "role": "A String", # Deprecated - use permissionDetails/role instead.
320 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
321 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
322 },
323 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800324 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700325 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700326 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800327 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
328 "photoLink": "A String", # A link to the user's profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700329 "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.
330 {
331 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
332 # - organizer
333 # - fileOrganizer
334 # - writer
335 # - commenter
336 # - reader
337 "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.
338 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
339 # - file
340 # - member
341 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
342 },
343 ],
344 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
345 # - They can only be set on user and group permissions
346 # - The time must be in the future
347 # - The time cannot be more than a year in the future
348 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800349 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700350 # - organizer
351 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800352 # - writer
353 # - commenter
354 # - reader
355 "type": "A String", # The type of the grantee. Valid values are:
356 # - user
357 # - group
358 # - domain
359 # - anyone
360 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
361 },
362 ],
363 }</pre>
364</div>
365
366<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700367 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
368 <pre>Retrieves the next page of results.
369
370Args:
371 previous_request: The request for the previous page. (required)
372 previous_response: The response from the request for the previous page. (required)
373
374Returns:
375 A request object that you can call 'execute()' on to request the next
376 page. Returns None if there are no more items in the collection.
377 </pre>
378</div>
379
380<div class="method">
381 <code class="details" id="update">update(fileId, permissionId, body, removeExpiration=None, supportsTeamDrives=None, supportsAllDrives=None, useDomainAdminAccess=None, transferOwnership=None)</code>
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800382 <pre>Updates a permission with patch semantics.
383
384Args:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700385 fileId: string, The ID of the file or shared drive. (required)
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800386 permissionId: string, The ID of the permission. (required)
387 body: object, The request body. (required)
388 The object takes the form of:
389
390{ # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
391 "domain": "A String", # The domain to which this permission refers.
392 "displayName": "A String", # A displayable name for users, groups or domains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700393 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
394 {
395 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
396 "role": "A String", # Deprecated - use permissionDetails/role instead.
397 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
398 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
399 },
400 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800401 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700403 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800404 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
405 "photoLink": "A String", # A link to the user's profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700406 "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.
407 {
408 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
409 # - organizer
410 # - fileOrganizer
411 # - writer
412 # - commenter
413 # - reader
414 "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.
415 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
416 # - file
417 # - member
418 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
419 },
420 ],
421 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
422 # - They can only be set on user and group permissions
423 # - The time must be in the future
424 # - The time cannot be more than a year in the future
425 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800426 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700427 # - organizer
428 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800429 # - writer
430 # - commenter
431 # - reader
432 "type": "A String", # The type of the grantee. Valid values are:
433 # - user
434 # - group
435 # - domain
436 # - anyone
437 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
438}
439
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700440 removeExpiration: boolean, Whether to remove the expiration date.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700441 supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead.
442 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.
443 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.
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800444 transferOwnership: boolean, Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect.
445
446Returns:
447 An object of the form:
448
449 { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy.
450 "domain": "A String", # The domain to which this permission refers.
451 "displayName": "A String", # A displayable name for users, groups or domains.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700452 "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead.
453 {
454 "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead.
455 "role": "A String", # Deprecated - use permissionDetails/role instead.
456 "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead.
457 "inherited": True or False, # Deprecated - use permissionDetails/inherited instead.
458 },
459 ],
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800460 "allowFileDiscovery": True or False, # Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700461 "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions.
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -0700462 "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission".
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800463 "emailAddress": "A String", # The email address of the user or group to which this permission refers.
464 "photoLink": "A String", # A link to the user's profile photo, if available.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700465 "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.
466 {
467 "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible:
468 # - organizer
469 # - fileOrganizer
470 # - writer
471 # - commenter
472 # - reader
473 "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.
474 "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible:
475 # - file
476 # - member
477 "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field.
478 },
479 ],
480 "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions:
481 # - They can only be set on user and group permissions
482 # - The time must be in the future
483 # - The time cannot be more than a year in the future
484 "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed:
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800485 # - owner
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700486 # - organizer
487 # - fileOrganizer
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800488 # - writer
489 # - commenter
490 # - reader
Jon Wayne Parrott36e41bc2016-02-19 16:02:29 -0800491 "type": "A String", # The type of the grantee. Valid values are:
492 # - user
493 # - group
494 # - domain
495 # - anyone
496 "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId.
497 }</pre>
498</div>
499
500</body></html>