For a list of methods for this resource, see the end of this page.
Resource representations
A permission for a file.
{ "kind": "drive#permission", "etag": etag, "id": string, "selfLink": string, "name": string, "emailAddress": string, "domain": string, "role": string, "additionalRoles": [ string ], "view": string, "type": string, "value": string, "authKey": string, "withLink": boolean, "photoLink": string, "expirationDate": datetime, "teamDrivePermissionDetails": [ { "teamDrivePermissionType": string, "role": string, "additionalRoles": [ string ], "inheritedFrom": string, "inherited": boolean } ], "permissionDetails": [ { "permissionType": string, "role": string, "additionalRoles": [ string ], "inheritedFrom": string, "inherited": boolean } ], "deleted": boolean, "pendingOwner": boolean }
Property name | Value | Description | Notes |
---|---|---|---|
kind |
string |
This is always drive#permission. | |
etag |
etag |
The ETag of the permission. | |
id |
string |
The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone , in which case both id and value are ignored. |
writable |
selfLink |
string |
A link back to this permission. | |
name |
string |
The name for this permission. | |
role |
string |
The primary role for this user. While new values may be supported in the future, the following are currently allowed:
|
writable |
additionalRoles[] |
list |
Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. |
writable |
type |
string |
The account type. Allowed values are:
|
writable |
authKey |
string |
Deprecated. | |
withLink |
boolean |
Whether the link is required for this permission. | writable |
photoLink |
string |
A link to the profile photo, if available. | |
value |
string |
The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone , in which case both id and value are ignored. |
writable |
emailAddress |
string |
The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group . |
|
domain |
string |
The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user , group or domain . |
|
expirationDate |
datetime |
The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions:
|
writable |
teamDrivePermissionDetails[] |
list |
Deprecated - use permissionDetails instead. |
|
teamDrivePermissionDetails[].teamDrivePermissionType |
string |
Deprecated - use permissionDetails/permissionType instead. |
|
teamDrivePermissionDetails[].role |
string |
Deprecated - use permissionDetails/role instead. |
|
teamDrivePermissionDetails[].additionalRoles[] |
list |
Deprecated - use permissionDetails/additionalRoles instead. |
|
teamDrivePermissionDetails[].inheritedFrom |
string |
Deprecated - use permissionDetails/inheritedFrom instead. |
|
teamDrivePermissionDetails[].inherited |
boolean |
Deprecated - use permissionDetails/inherited instead. |
|
deleted |
boolean |
Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. | |
permissionDetails[] |
list |
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. | |
permissionDetails[].permissionType |
string |
The permission type for this user. While new values may be added in future, the following are currently possible:
|
|
permissionDetails[].role |
string |
The primary role for this user. While new values may be added in the future, the following are currently possible:
|
|
permissionDetails[].additionalRoles[] |
list |
Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. |
|
permissionDetails[].inheritedFrom |
string |
The ID of the item from which this permission is inherited. This is an output-only field. | |
permissionDetails[].inherited |
boolean |
Whether this permission is inherited. This field is always populated. This is an output-only field. | |
view |
string |
Indicates the view for this permission. Only populated for permissions that belong to a view. published is the only supported value. |
writable |
pendingOwner |
boolean |
Whether the account associated with this permission is a pending owner. Only populated for user type permissions for files that are not in a shared drive. |
writable |
Methods
- delete
- Deletes a permission from a file or shared drive.
- get
- Gets a permission by ID.
- insert
- Inserts a permission for a file or shared drive.
- list
- Lists a file's or shared drive's permissions.
- patch
- Updates a permission using patch semantics.
- update
- Updates a permission.
- getIdForEmail
- Returns the permission ID for an email address.