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