Menetapkan kebijakan kontrol akses untuk resource. Jika ada, kebijakan akan diganti. Pemanggil harus memiliki izin Google IAM yang tepat pada resource.
Permintaan HTTP
POST https://identitytoolkit.googleapis.com/admin/v2/{resource=projects/*/tenants/*}:setIamPolicy
WAJIB: Kebijakan lengkap yang akan diterapkan ke resource. Ukuran kebijakan dibatasi hingga beberapa 10 KB. Kebijakan kosong adalah kebijakan yang valid, tetapi layanan Google Cloud tertentu (seperti Project) mungkin menolaknya.
OPSIONAL: FieldMask yang menentukan kolom kebijakan yang akan diubah. Hanya kolom dalam mask yang akan diubah. Jika tidak ada mask yang diberikan, mask default berikut akan digunakan:
paths: "bindings, etag"
Ini adalah daftar dipisahkan koma yang berisi nama-nama kolom yang sepenuhnya memenuhi syarat. Contoh: "user.displayName,photo".
Isi respons
Jika berhasil, isi respons akan berisi instance Policy.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-03-04 UTC."],[[["\u003cp\u003eThis API call sets or replaces the access control policy for a specified resource, requiring appropriate Google IAM permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe HTTP request is a \u003ccode\u003ePOST\u003c/code\u003e method to a URL that adheres to gRPC Transcoding syntax, and it requires a resource path parameter.\u003c/p\u003e\n"],["\u003cp\u003eThe request body contains a JSON representation with a required \u003ccode\u003epolicy\u003c/code\u003e object and an optional \u003ccode\u003eupdateMask\u003c/code\u003e string for selective modification of the policy.\u003c/p\u003e\n"],["\u003cp\u003eA successful call returns a response body that includes an instance of the \u003ccode\u003ePolicy\u003c/code\u003e, while the policy size is limited to a few 10s of KB.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires one of the listed OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/identitytoolkit\u003c/code\u003e, \u003ccode\u003ehttps://www.googleapis.com/auth/firebase\u003c/code\u003e, or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.tenants.setIamPolicy\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nSets the access control policy for a resource. If the policy exists, it is replaced. Caller must have the right Google IAM permission on the resource.\n\n### HTTP request\n\n`POST https://identitytoolkit.googleapis.com/admin/v2/{resource=projects/*/tenants/*}:setIamPolicy`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\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 [Policy](/identity-platform/docs/reference/rest/v2/Policy).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/identitytoolkit`\n- `\n https://www.googleapis.com/auth/firebase`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]