Enum AuthorizationStatus
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
وضعیت مجوز شمارشی که وضعیت مجوز یک اسکریپت را نشان می دهد.
برای فراخوانی یک enum، کلاس والد، نام و ویژگی آن را فراخوانی می کنید. برای مثال، ScriptApp.AuthorizationStatus.REQUIRED
.
خواص
اموال | تایپ کنید | توضیحات |
---|
REQUIRED | Enum | کاربر برای استفاده از یک یا چند سرویس باید به این اسکریپت مجوز دهد. در بیشتر موارد، اسکریپت دفعه بعد که اجرا می شود از کاربر درخواست مجوز می کند. با این حال، اگر اسکریپت بهعنوان افزونهای منتشر شود که از محرکهای قابل نصب استفاده میکند، ماشه اسکریپت را بدون درخواست مجوز اجرا میکند، اما اگر اسکریپت تلاش کند سرویس غیرمجاز را فراخوانی کند، یک استثنا ایجاد میکند. |
NOT_REQUIRED | Enum | کاربر تمام مجوزهایی را که در حال حاضر نیاز دارد به این اسکریپت داده است. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eAuthorizationStatus is an enumeration used to represent the authorization level of a script.\u003c/p\u003e\n"],["\u003cp\u003eScripts may require user authorization to access certain services, indicated by \u003ccode\u003eScriptApp.AuthorizationStatus.REQUIRED\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIf a script has all necessary authorizations, its status is represented by \u003ccode\u003eScriptApp.AuthorizationStatus.NOT_REQUIRED\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAdd-ons using installable triggers might run without explicit authorization prompts but will throw exceptions when attempting to use unauthorized services.\u003c/p\u003e\n"]]],[],null,["# Enum AuthorizationStatus\n\nAuthorizationStatus\n\nAn enumeration denoting the authorization status of a script.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nScriptApp.AuthorizationStatus.REQUIRED`. \n\n### Properties\n\n| Property | Type | Description |\n|----------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `REQUIRED` | `Enum` | The user needs to authorize this script to use one or more services. In most cases, the script prompts the user for authorization the next time it runs; however, if the script is published as an [add-on](/gsuite/add-ons/overview) that uses [installable triggers](/apps-script/understanding_triggers), the trigger runs the script without prompting for authorization but throws an exception if the script attempts to call the unauthorized service. |\n| `NOT_REQUIRED` | `Enum` | The user has granted this script all the authorization it currently requires. |"]]