Stay organized with collections
Save 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 form projects/{project}/locations/{location}/documents/{document}.
Request body
The request body contains data with the following structure:
Required. REQUIRED: The complete policy to be applied to the resource. 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 is DocumentSchemaId or 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.
[[["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, which is an IAM policy that controls access, and can be limited to a size of a few 10s of KB.\u003c/p\u003e\n"],["\u003cp\u003eSetting project ACLs allows conditions with operators like \u003ccode\u003e=\u003c/code\u003e, \u003ccode\u003e!=\u003c/code\u003e, \u003ccode\u003e<\u003c/code\u003e, \u003ccode\u003e<=\u003c/code\u003e, \u003ccode\u003e>\u003c/code\u003e, and \u003ccode\u003e>=\u003c/code\u003e, and supports boolean expressions up to 3 levels of nesting.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprojectOwner\u003c/code\u003e boolean field in the request body, when set to true, bypasses authorization checks for end users, and applies to the Project ACL only.\u003c/p\u003e\n"]]],[],null,["# Method: projects.locations.documents.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)."]]