If you are creating a new function, see the Console Quickstart on Cloud Run. The content on this page only applies to existing legacy functions created with the Cloud Functions v2 API.
Tests the specified permissions against the IAM access control policy for a function. If the function does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
HTTP request
POST https://cloudfunctions.googleapis.com/v1/{resource}:testIamPermissions
Path parameters
Parameters
resource
string
REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field. It takes the form projects/{project}/locations/{location}/functions/{function}.
Request body
The request body contains data with the following structure:
JSON representation
{"permissions": [string]}
Fields
permissions[]
string
The set of permissions to check for the resource. Permissions with wildcards (such as * or storage.*) are not allowed. For more information see IAM Overview.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-08 UTC."],[[["This API endpoint tests IAM permissions for a specified Google Cloud Function, returning an empty set if the function doesn't exist."],["The HTTP request method is `POST` to `https://cloudfunctions.googleapis.com/v1/{resource}:testIamPermissions`, requiring a resource path parameter in the format `projects/{project}/locations/{location}/functions/{function}`."],["The request body should be in JSON format, containing a list of permissions to be tested against the specified resource, with no wildcard permissions allowed."],["A successful response provides an instance of `TestIamPermissionsResponse`, outlining the permissions that are available."],["This API requires one of the following OAuth scopes: `https://www.googleapis.com/auth/cloudfunctions` or `https://www.googleapis.com/auth/cloud-platform`."]]],[]]