Google Drive (Service Account) icon

Google Drive (Service Account)

Access Google Drive API using Service Account

Overview

This node allows interaction with Google Drive using a Service Account for authentication. Specifically, the 'Permission: Get' operation retrieves details about a specific permission on a Google Drive file. This is useful for scenarios where you need to audit or verify access rights on files programmatically, such as checking who has access to a file or what level of access they have.

Use Case Examples

  1. Retrieve permission details for a given file and permission ID to audit access rights.
  2. Use in automated workflows to verify permission settings before performing file operations.

Properties

Name Meaning
Authentication Choose the authentication method: use saved credentials or enter them manually.
Service Account Email Email address of the Google service account used for authentication (required if manual authentication is selected).
Private Key Private key from the service account JSON used for authentication (required if manual authentication is selected).
Impersonate Email (Optional) Email of the user to impersonate, requires domain-wide delegation (optional, manual auth only).
File ID The ID of the Google Drive file for which the permission is being queried.
Permission ID The ID of the specific permission to retrieve details for on the given file.

Output

JSON

  • json
    • id - The ID of the permission.
    • type - The type of the grantee (user, group, domain, anyone).
    • role - The role granted by this permission (owner, writer, reader, etc.).
    • emailAddress - Email address of the user or group (if applicable).
    • domain - Domain name (if applicable).
    • allowFileDiscovery - Whether the permission allows file discovery (for domain permissions).
    • displayName - Display name of the user or group (if available).
    • photoLink - Link to the user's photo (if available).

Dependencies

  • Google Drive API via googleapis library
  • Service Account credentials for authentication

Troubleshooting

  • Ensure that the service account has the necessary permissions to access the file and its permissions.
  • If using manual authentication, verify that the private key is correctly formatted and includes proper newline characters.
  • Common errors include 'No credentials provided' if credentials are missing, or permission denied errors if the service account or impersonated user lacks access rights.
  • Check that the file ID and permission ID are correct and exist in the Google Drive associated with the service account.

Links

Discussion