Method: projects.assets.testIamPermissions
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مجوزهایی را که تماس گیرنده در منبع مشخص شده دارد، برمی گرداند. اگر منبع وجود نداشته باشد، این یک مجموعه خالی از مجوزها را برمی گرداند، نه یک خطای NOT_FOUND.
توجه: این عملیات برای استفاده برای رابطهای کاربری آگاه از مجوز و ابزارهای خط فرمان طراحی شده است، نه برای بررسی مجوز. این عملیات ممکن است بدون اخطار "باز شود".
درخواست HTTP
POST https://earthengine.googleapis.com/v1beta/{resource=projects/*/assets/**}:testIamPermissions
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
پارامترها |
---|
resource | string مورد نیاز: منبعی که جزئیات خط مشی برای آن درخواست شده است. برای مقدار مناسب این فیلد ، نام منابع را ببینید. |
درخواست بدن
بدنه درخواست حاوی داده هایی با ساختار زیر است:
نمایندگی JSON |
---|
{
"permissions": [
string
]
} |
فیلدها |
---|
permissions[] | string مجموعه ای از مجوزها برای بررسی resource . مجوزهای دارای حروف عام (مانند * یا storage.* ) مجاز نیستند. برای اطلاعات بیشتر به نمای کلی IAM مراجعه کنید. |
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی نمونه ای از TestIamPermissionsResponse
است.
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/earthengine
-
https://www.googleapis.com/auth/earthengine.readonly
-
https://www.googleapis.com/auth/cloud-platform
-
https://www.googleapis.com/auth/cloud-platform.read-only
برای اطلاعات بیشتر، بهOAuth 2.0 Overview .
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eReturns the permissions a caller has on a specified Earth Engine resource.\u003c/p\u003e\n"],["\u003cp\u003eIf the resource doesn't exist, it returns an empty set of permissions instead of an error.\u003c/p\u003e\n"],["\u003cp\u003ePrimarily used for building permission-aware UIs and tools, not for authorization checks.\u003c/p\u003e\n"],["\u003cp\u003eRequires specific OAuth scopes like \u003ccode\u003ehttps://www.googleapis.com/auth/earthengine\u003c/code\u003e for authorization.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to \u003ccode\u003ehttps://earthengine.googleapis.com/v1beta/{resource=projects/*/assets/**}:testIamPermissions\u003c/code\u003e with the resource and desired permissions in the request body.\u003c/p\u003e\n"]]],[],null,["# Method: projects.assets.testIamPermissions\n\nReturns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1beta/{resource=projects/*/assets/**}:testIamPermissions`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `resource` | `string` REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------|\n| ``` { \"permissions\": [ string ] } ``` |\n\n| Fields ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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](https://cloud.google.com/iam/docs/overview#permissions). |\n\n### Response body\n\nIf successful, the response body contains an instance of [TestIamPermissionsResponse](/earth-engine/reference/rest/Shared.Types/TestIamPermissionsResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/earthengine`\n- `\n https://www.googleapis.com/auth/earthengine.readonly`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/cloud-platform.read-only`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]