Stay organized with collectionsSave and categorize content based on your preferences.
Sets the access control policy for a resource. Replaces any existing policy.
HTTP request
POST https://contentwarehouse.googleapis.com/v1/{resource}:setAcl
Path parameters
Parameters
resource
string
Required. REQUIRED: The resource for which the policy is being requested. Format for document: projects/{projectNumber}/locations/{location}/documents/{documentId}. Format for collection: projects/{projectNumber}/locations/{location}/collections/{collectionId}. Format for project: projects/{projectNumber}. It takes the formprojects/{project}.
Request body
The request body contains data with the following structure:
Required. REQUIRED: The complete policy to be applied to theresource. The size of the policy is limited to a few 10s of KB. This refers to an Identity and Access (IAM) policy, which specifies access controls for the Document.
You can set ACL with condition for projects only.
Supported operators are:=,!=,<,<=,>, and>=where the left of the operator isDocumentSchemaIdor property name and the right of the operator is a number or a quoted string. You must escape backslash (\) and quote (") characters.
Boolean expressions (AND/OR) are supported up to 3 levels of nesting (for example, "((A AND B AND C) OR D) AND E"), a maximum of 10 comparisons are allowed in the expression. The expression must be < 6000 bytes in length.
Sample condition:"DocumentSchemaId = \"some schema id\" OR SchemaId.floatPropertyName
>= 10"
[[["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-05-08 UTC."],[[["\u003cp\u003eThis endpoint sets the access control policy for a specified resource, replacing any existing policy.\u003c/p\u003e\n"],["\u003cp\u003eThe resource can be a document, a collection, or an entire project, identified by a specific format in the request's path parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must include a complete policy, request metadata, and a projectOwner flag for project ACL setting.\u003c/p\u003e\n"],["\u003cp\u003eApplying access controls is done using an Identity and Access (IAM) policy, that has specific length requirements, and supports comparison operators and boolean expressions, with a set limit to their complexity.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires OAuth scope \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e and the \u003ccode\u003econtentwarehouse.documents.setIamPolicy\u003c/code\u003e IAM permission.\u003c/p\u003e\n"]]],[],null,["# Method: projects.setAcl\n\nSets the access control policy for a resource. Replaces any existing policy.\n\n### HTTP request\n\n`POST https://contentwarehouse.googleapis.com/v1/{resource}:setAcl`\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [SetAclResponse](/document-warehouse/docs/reference/rest/v1/SetAclResponse).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](https://cloud.google.com/docs/authentication/).\n\n### IAM Permissions\n\nRequires the following [IAM](https://cloud.google.com/iam/docs) permission on the `resource` resource:\n\n- `contentwarehouse.documents.setIamPolicy`\n\nFor more information, see the [IAM documentation](https://cloud.google.com/iam/docs)."]]