Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 78 | <code><a href="#close">close()</a></code></p> |
| 79 | <p class="firstline">Close httplib2 connections.</p> |
| 80 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 81 | <code><a href="#create">create(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmail=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 82 | <p class="firstline">Creates a permission for a file or shared drive.</p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 83 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 84 | <code><a href="#delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 85 | <p class="firstline">Deletes a permission.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 87 | <code><a href="#get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 88 | <p class="firstline">Gets a permission by ID.</p> |
| 89 | <p class="toc_element"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 90 | <code><a href="#list">list(fileId, includePermissionsForView=None, pageSize=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 91 | <p class="firstline">Lists a file's or shared drive's permissions.</p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 92 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 93 | <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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 96 | <code><a href="#update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</a></code></p> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 97 | <p class="firstline">Updates a permission with patch semantics.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 100 | <code class="details" id="close">close()</code> |
| 101 | <pre>Close httplib2 connections.</pre> |
| 102 | </div> |
| 103 | |
| 104 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 105 | <code class="details" id="create">create(fileId, body=None, emailMessage=None, enforceSingleParent=None, moveToNewOwnersRoot=None, sendNotificationEmail=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 106 | <pre>Creates a permission for a file or shared drive. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 107 | |
| 108 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 109 | fileId: string, The ID of the file or shared drive. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 110 | body: object, The request body. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 111 | The object takes the form of: |
| 112 | |
| 113 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 114 | "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. |
| 115 | "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. |
| 116 | "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: |
| 117 | # - user - User's full name, as defined for their Google account, such as "Joe Smith." |
| 118 | # - group - Name of the Google Group, such as "The Company Administrators." |
| 119 | # - domain - String domain name, such as "thecompany.com." |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 120 | # - anyone - No displayName is present. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 121 | "domain": "A String", # The domain to which this permission refers. |
| 122 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 123 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: |
| 124 | # - They can only be set on user and group permissions |
| 125 | # - The time must be in the future |
| 126 | # - The time cannot be more than a year in the future |
| 127 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. |
| 128 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
| 129 | "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. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 130 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 131 | "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. |
| 132 | "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. |
| 133 | "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: |
| 134 | # - file |
| 135 | # - member |
| 136 | "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 137 | # - organizer |
| 138 | # - fileOrganizer |
| 139 | # - writer |
| 140 | # - commenter |
| 141 | # - reader |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 142 | }, |
| 143 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 144 | "photoLink": "A String", # A link to the user's profile photo, if available. |
| 145 | "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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 146 | # - owner |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 147 | # - organizer |
| 148 | # - fileOrganizer |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 149 | # - writer |
| 150 | # - commenter |
| 151 | # - reader |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 152 | "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. |
| 153 | { |
| 154 | "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. |
| 155 | "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. |
| 156 | "role": "A String", # Deprecated - use permissionDetails/role instead. |
| 157 | "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. |
| 158 | }, |
| 159 | ], |
| 160 | "type": "A String", # The type of the grantee. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 161 | # - user |
| 162 | # - group |
| 163 | # - domain |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 164 | # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 165 | "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 166 | } |
| 167 | |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 168 | emailMessage: string, A plain text custom message to include in the notification email. |
Yoshi Automation Bot | c2228be | 2020-11-24 15:48:03 -0800 | [diff] [blame] | 169 | enforceSingleParent: boolean, Deprecated. See moveToNewOwnersRoot for details. |
| 170 | moveToNewOwnersRoot: boolean, This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, parents are not changed. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 171 | 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 Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 172 | supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 173 | supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. |
| 174 | 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 Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 175 | 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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 176 | |
| 177 | Returns: |
| 178 | An object of the form: |
| 179 | |
| 180 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 181 | "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. |
| 182 | "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. |
| 183 | "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: |
| 184 | # - user - User's full name, as defined for their Google account, such as "Joe Smith." |
| 185 | # - group - Name of the Google Group, such as "The Company Administrators." |
| 186 | # - domain - String domain name, such as "thecompany.com." |
| 187 | # - anyone - No displayName is present. |
| 188 | "domain": "A String", # The domain to which this permission refers. |
| 189 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 190 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: |
| 191 | # - They can only be set on user and group permissions |
| 192 | # - The time must be in the future |
| 193 | # - The time cannot be more than a year in the future |
| 194 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. |
| 195 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
| 196 | "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. |
| 197 | { |
| 198 | "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. |
| 199 | "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. |
| 200 | "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: |
| 201 | # - file |
| 202 | # - member |
| 203 | "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: |
| 204 | # - organizer |
| 205 | # - fileOrganizer |
| 206 | # - writer |
| 207 | # - commenter |
| 208 | # - reader |
| 209 | }, |
| 210 | ], |
| 211 | "photoLink": "A String", # A link to the user's profile photo, if available. |
| 212 | "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: |
| 213 | # - owner |
| 214 | # - organizer |
| 215 | # - fileOrganizer |
| 216 | # - writer |
| 217 | # - commenter |
| 218 | # - reader |
| 219 | "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. |
| 220 | { |
| 221 | "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. |
| 222 | "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. |
| 223 | "role": "A String", # Deprecated - use permissionDetails/role instead. |
| 224 | "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. |
| 225 | }, |
| 226 | ], |
| 227 | "type": "A String", # The type of the grantee. Valid values are: |
| 228 | # - user |
| 229 | # - group |
| 230 | # - domain |
| 231 | # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. |
| 232 | "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
| 233 | }</pre> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 234 | </div> |
| 235 | |
| 236 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 237 | <code class="details" id="delete">delete(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 238 | <pre>Deletes a permission. |
| 239 | |
| 240 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 241 | fileId: string, The ID of the file or shared drive. (required) |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 242 | permissionId: string, The ID of the permission. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 243 | supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 244 | supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 245 | 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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 246 | </pre> |
| 247 | </div> |
| 248 | |
| 249 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 250 | <code class="details" id="get">get(fileId, permissionId, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 251 | <pre>Gets a permission by ID. |
| 252 | |
| 253 | Args: |
| 254 | fileId: string, The ID of the file. (required) |
| 255 | permissionId: string, The ID of the permission. (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 256 | supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 257 | supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 258 | 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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 259 | |
| 260 | Returns: |
| 261 | An object of the form: |
| 262 | |
| 263 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 264 | "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. |
| 265 | "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. |
| 266 | "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: |
| 267 | # - user - User's full name, as defined for their Google account, such as "Joe Smith." |
| 268 | # - group - Name of the Google Group, such as "The Company Administrators." |
| 269 | # - domain - String domain name, such as "thecompany.com." |
| 270 | # - anyone - No displayName is present. |
| 271 | "domain": "A String", # The domain to which this permission refers. |
| 272 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 273 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: |
| 274 | # - They can only be set on user and group permissions |
| 275 | # - The time must be in the future |
| 276 | # - The time cannot be more than a year in the future |
| 277 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. |
| 278 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
| 279 | "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. |
| 280 | { |
| 281 | "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. |
| 282 | "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. |
| 283 | "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: |
| 284 | # - file |
| 285 | # - member |
| 286 | "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: |
| 287 | # - organizer |
| 288 | # - fileOrganizer |
| 289 | # - writer |
| 290 | # - commenter |
| 291 | # - reader |
| 292 | }, |
| 293 | ], |
| 294 | "photoLink": "A String", # A link to the user's profile photo, if available. |
| 295 | "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: |
| 296 | # - owner |
| 297 | # - organizer |
| 298 | # - fileOrganizer |
| 299 | # - writer |
| 300 | # - commenter |
| 301 | # - reader |
| 302 | "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. |
| 303 | { |
| 304 | "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. |
| 305 | "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. |
| 306 | "role": "A String", # Deprecated - use permissionDetails/role instead. |
| 307 | "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. |
| 308 | }, |
| 309 | ], |
| 310 | "type": "A String", # The type of the grantee. Valid values are: |
| 311 | # - user |
| 312 | # - group |
| 313 | # - domain |
| 314 | # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. |
| 315 | "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
| 316 | }</pre> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 317 | </div> |
| 318 | |
| 319 | <div class="method"> |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 320 | <code class="details" id="list">list(fileId, includePermissionsForView=None, pageSize=None, pageToken=None, supportsAllDrives=None, supportsTeamDrives=None, useDomainAdminAccess=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 321 | <pre>Lists a file's or shared drive's permissions. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 322 | |
| 323 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 324 | fileId: string, The ID of the file or shared drive. (required) |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 325 | includePermissionsForView: string, Specifies which additional view's permissions to include in the response. Only 'published' is supported. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 326 | 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. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 327 | 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 Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 328 | supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 329 | supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 330 | 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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 331 | |
| 332 | Returns: |
| 333 | An object of the form: |
| 334 | |
| 335 | { # A list of permissions for a file. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 336 | "kind": "drive#permissionList", # Identifies what kind of resource this is. Value: the fixed string "drive#permissionList". |
| 337 | "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. |
| 338 | "permissions": [ # The list of permissions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. |
| 339 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
| 340 | "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. |
| 341 | "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. |
| 342 | "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: |
| 343 | # - user - User's full name, as defined for their Google account, such as "Joe Smith." |
| 344 | # - group - Name of the Google Group, such as "The Company Administrators." |
| 345 | # - domain - String domain name, such as "thecompany.com." |
| 346 | # - anyone - No displayName is present. |
| 347 | "domain": "A String", # The domain to which this permission refers. |
| 348 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 349 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: |
| 350 | # - They can only be set on user and group permissions |
| 351 | # - The time must be in the future |
| 352 | # - The time cannot be more than a year in the future |
| 353 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. |
| 354 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
| 355 | "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. |
| 356 | { |
| 357 | "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. |
| 358 | "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. |
| 359 | "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: |
| 360 | # - file |
| 361 | # - member |
| 362 | "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: |
| 363 | # - organizer |
| 364 | # - fileOrganizer |
| 365 | # - writer |
| 366 | # - commenter |
| 367 | # - reader |
| 368 | }, |
| 369 | ], |
| 370 | "photoLink": "A String", # A link to the user's profile photo, if available. |
| 371 | "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: |
| 372 | # - owner |
| 373 | # - organizer |
| 374 | # - fileOrganizer |
| 375 | # - writer |
| 376 | # - commenter |
| 377 | # - reader |
| 378 | "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. |
| 379 | { |
| 380 | "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. |
| 381 | "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. |
| 382 | "role": "A String", # Deprecated - use permissionDetails/role instead. |
| 383 | "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. |
| 384 | }, |
| 385 | ], |
| 386 | "type": "A String", # The type of the grantee. Valid values are: |
| 387 | # - user |
| 388 | # - group |
| 389 | # - domain |
| 390 | # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. |
| 391 | "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
| 392 | }, |
| 393 | ], |
| 394 | }</pre> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 395 | </div> |
| 396 | |
| 397 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 398 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 399 | <pre>Retrieves the next page of results. |
| 400 | |
| 401 | Args: |
| 402 | previous_request: The request for the previous page. (required) |
| 403 | previous_response: The response from the request for the previous page. (required) |
| 404 | |
| 405 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 406 | A request object that you can call 'execute()' on to request the next |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 407 | page. Returns None if there are no more items in the collection. |
| 408 | </pre> |
| 409 | </div> |
| 410 | |
| 411 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 412 | <code class="details" id="update">update(fileId, permissionId, body=None, removeExpiration=None, supportsAllDrives=None, supportsTeamDrives=None, transferOwnership=None, useDomainAdminAccess=None)</code> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 413 | <pre>Updates a permission with patch semantics. |
| 414 | |
| 415 | Args: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 416 | fileId: string, The ID of the file or shared drive. (required) |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 417 | permissionId: string, The ID of the permission. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 418 | body: object, The request body. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 419 | The object takes the form of: |
| 420 | |
| 421 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 422 | "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. |
| 423 | "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. |
| 424 | "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: |
| 425 | # - user - User's full name, as defined for their Google account, such as "Joe Smith." |
| 426 | # - group - Name of the Google Group, such as "The Company Administrators." |
| 427 | # - domain - String domain name, such as "thecompany.com." |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 428 | # - anyone - No displayName is present. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 429 | "domain": "A String", # The domain to which this permission refers. |
| 430 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 431 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: |
| 432 | # - They can only be set on user and group permissions |
| 433 | # - The time must be in the future |
| 434 | # - The time cannot be more than a year in the future |
| 435 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. |
| 436 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
| 437 | "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. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 438 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 439 | "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. |
| 440 | "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. |
| 441 | "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: |
| 442 | # - file |
| 443 | # - member |
| 444 | "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 445 | # - organizer |
| 446 | # - fileOrganizer |
| 447 | # - writer |
| 448 | # - commenter |
| 449 | # - reader |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 450 | }, |
| 451 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 452 | "photoLink": "A String", # A link to the user's profile photo, if available. |
| 453 | "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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 454 | # - owner |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 455 | # - organizer |
| 456 | # - fileOrganizer |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 457 | # - writer |
| 458 | # - commenter |
| 459 | # - reader |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 460 | "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. |
| 461 | { |
| 462 | "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. |
| 463 | "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. |
| 464 | "role": "A String", # Deprecated - use permissionDetails/role instead. |
| 465 | "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. |
| 466 | }, |
| 467 | ], |
| 468 | "type": "A String", # The type of the grantee. Valid values are: |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 469 | # - user |
| 470 | # - group |
| 471 | # - domain |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 472 | # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. |
Dmitry Frenkel | 3e17f89 | 2020-10-06 16:46:05 -0700 | [diff] [blame] | 473 | "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 474 | } |
| 475 | |
Jon Wayne Parrott | 7d5badb | 2016-08-16 12:44:29 -0700 | [diff] [blame] | 476 | removeExpiration: boolean, Whether to remove the expiration date. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 477 | supportsAllDrives: boolean, Whether the requesting application supports both My Drives and shared drives. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 478 | supportsTeamDrives: boolean, Deprecated use supportsAllDrives instead. |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 479 | 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 Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 480 | 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 Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 481 | |
| 482 | Returns: |
| 483 | An object of the form: |
| 484 | |
| 485 | { # A permission for a file. A permission grants a user, group, domain or the world access to a file or a folder hierarchy. |
Yoshi Automation Bot | cc94ec8 | 2021-01-15 07:10:04 -0800 | [diff] [blame] | 486 | "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. |
| 487 | "deleted": True or False, # Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. |
| 488 | "displayName": "A String", # The "pretty" name of the value of the permission. The following is a list of examples for each type of permission: |
| 489 | # - user - User's full name, as defined for their Google account, such as "Joe Smith." |
| 490 | # - group - Name of the Google Group, such as "The Company Administrators." |
| 491 | # - domain - String domain name, such as "thecompany.com." |
| 492 | # - anyone - No displayName is present. |
| 493 | "domain": "A String", # The domain to which this permission refers. |
| 494 | "emailAddress": "A String", # The email address of the user or group to which this permission refers. |
| 495 | "expirationTime": "A String", # The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: |
| 496 | # - They can only be set on user and group permissions |
| 497 | # - The time must be in the future |
| 498 | # - The time cannot be more than a year in the future |
| 499 | "id": "A String", # The ID of this permission. This is a unique identifier for the grantee, and is published in User resources as permissionId. IDs should be treated as opaque values. |
| 500 | "kind": "drive#permission", # Identifies what kind of resource this is. Value: the fixed string "drive#permission". |
| 501 | "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. |
| 502 | { |
| 503 | "inherited": True or False, # Whether this permission is inherited. This field is always populated. This is an output-only field. |
| 504 | "inheritedFrom": "A String", # The ID of the item from which this permission is inherited. This is an output-only field. |
| 505 | "permissionType": "A String", # The permission type for this user. While new values may be added in future, the following are currently possible: |
| 506 | # - file |
| 507 | # - member |
| 508 | "role": "A String", # The primary role for this user. While new values may be added in the future, the following are currently possible: |
| 509 | # - organizer |
| 510 | # - fileOrganizer |
| 511 | # - writer |
| 512 | # - commenter |
| 513 | # - reader |
| 514 | }, |
| 515 | ], |
| 516 | "photoLink": "A String", # A link to the user's profile photo, if available. |
| 517 | "role": "A String", # The role granted by this permission. While new values may be supported in the future, the following are currently allowed: |
| 518 | # - owner |
| 519 | # - organizer |
| 520 | # - fileOrganizer |
| 521 | # - writer |
| 522 | # - commenter |
| 523 | # - reader |
| 524 | "teamDrivePermissionDetails": [ # Deprecated - use permissionDetails instead. |
| 525 | { |
| 526 | "inherited": True or False, # Deprecated - use permissionDetails/inherited instead. |
| 527 | "inheritedFrom": "A String", # Deprecated - use permissionDetails/inheritedFrom instead. |
| 528 | "role": "A String", # Deprecated - use permissionDetails/role instead. |
| 529 | "teamDrivePermissionType": "A String", # Deprecated - use permissionDetails/permissionType instead. |
| 530 | }, |
| 531 | ], |
| 532 | "type": "A String", # The type of the grantee. Valid values are: |
| 533 | # - user |
| 534 | # - group |
| 535 | # - domain |
| 536 | # - anyone When creating a permission, if type is user or group, you must provide an emailAddress for the user or group. When type is domain, you must provide a domain. There isn't extra information required for a anyone type. |
| 537 | "view": "A String", # Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
| 538 | }</pre> |
Jon Wayne Parrott | 36e41bc | 2016-02-19 16:02:29 -0800 | [diff] [blame] | 539 | </div> |
| 540 | |
| 541 | </body></html> |