একটি enum কল করার জন্য, আপনি তার পিতামাতার শ্রেণী, নাম এবং সম্পত্তি কল করুন। উদাহরণস্বরূপ, ScriptApp.AuthMode.CUSTOM_FUNCTION ।
functiononOpen(e){constmenu=SpreadsheetApp.getUi().createAddonMenu();if(e && e.authMode===ScriptApp.AuthMode.NONE){// Add a normal menu item (works in all authorization modes).menu.addItem('Start workflow','startWorkflow');}else{// Add a menu item based on properties (doesn't work in AuthMode.NONE).constproperties=PropertiesService.getDocumentProperties();constworkflowStarted=properties.getProperty('workflowStarted');if(workflowStarted){menu.addItem('Check workflow status','checkWorkflow');}else{menu.addItem('Start workflow','startWorkflow');}// Record analytics.UrlFetchApp.fetch('http://www.example.com/analytics?event=open');}menu.addToUi();}
বৈশিষ্ট্য
সম্পত্তি
টাইপ
বর্ণনা
NONE
Enum
একটি মোড যা অনুমোদনের প্রয়োজন এমন কোনো পরিষেবায় অ্যাক্সেসের অনুমতি দেয় না। এই মোডটি ঘটে যখন একটি অ্যাড-অন একটি on Open(e) সাধারণ ট্রিগার চালায় এবং ব্যবহারকারী একটি ভিন্ন নথিতে একটি অ্যাড-অন ইনস্টল করেছেন কিন্তু বর্তমান নথিতে অ্যাড-অন ব্যবহার করা হয়নি।
CUSTOM_FUNCTION
Enum
একটি মোড যা কাস্টম স্প্রেডশীট ফাংশনে ব্যবহারের জন্য পরিষেবার সীমিত উপসেটে অ্যাক্সেসের অনুমতি দেয়। এই পরিষেবাগুলির মধ্যে কিছু - স্প্রেডশীট পরিষেবাতে শুধুমাত্র-পঠন অ্যাক্সেস সহ - সাধারণত অনুমোদনের প্রয়োজন হয়, কিন্তু একটি কাস্টম ফাংশনে ব্যবহার করার সময় অনুমোদন ছাড়াই অনুমতি দেওয়া হয়। যেহেতু কাস্টম ফাংশন একটি ইভেন্ট প্যারামিটার অন্তর্ভুক্ত করে না, এই মানটি কখনই ফেরত দেওয়া হয় না; এটি শুধুমাত্র প্রদর্শন করার জন্য নথিভুক্ত করা হয়েছে যে কাস্টম ফাংশনগুলি তাদের নিজস্ব অনুমোদন মোডে চলে।
LIMITED
Enum
একটি মোড যা পরিষেবার একটি সীমিত উপসেটে অ্যাক্সেসের অনুমতি দেয়। এই মোডটি ঘটে যখন একটি অ্যাড-অন বা একটি ডকুমেন্টের সাথে আবদ্ধ একটি স্ক্রিপ্ট একটি on Open(e) বা on Edit(e) সাধারণ ট্রিগার কার্যকর করে, NONE এর জন্য বর্ণিত ক্ষেত্রে ছাড়া।
FULL
Enum
একটি মোড যা অনুমোদনের প্রয়োজন এমন সমস্ত পরিষেবাগুলিতে অ্যাক্সেসের অনুমতি দেয়৷ এই মোডটি ঘটে যখন একটি অ্যাড-অন বা একটি স্ক্রিপ্ট LIMITED বা NONE এর জন্য বর্ণিত কেস ব্যতীত অন্য কোনো ট্রিগারের ফলাফল হিসাবে সঞ্চালিত হয়।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eAuthMode defines the level of access Apps Script has to authorized services when a triggered function is executed.\u003c/p\u003e\n"],["\u003cp\u003eIt's crucial for understanding how add-ons and scripts interact with Google services, especially concerning user authorization.\u003c/p\u003e\n"],["\u003cp\u003eDifferent AuthModes like NONE, LIMITED, and FULL, dictate the scope of service access, impacting functionalities within triggered functions.\u003c/p\u003e\n"],["\u003cp\u003eCustom functions operate under a specific authorization mode that allows restricted access to certain services without explicit user authorization.\u003c/p\u003e\n"]]],[],null,["AuthMode\n\nAn enumeration that identifies which categories of authorized services Apps Script is able to\nexecute through a triggered function. These values are exposed in [triggered functions](/apps-script/understanding_triggers) as the `auth``Mode`\nproperty of the [event parameter](/apps-script/understanding_events), `e`. For\nmore information, see the [guide to the\nauthorization lifecycle for add-ons](/gsuite/add-ons/concepts/addon-authorization#authorization_modes).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nScriptApp.AuthMode.CUSTOM_FUNCTION`.\n\n```javascript\nfunction onOpen(e) {\n const menu = SpreadsheetApp.getUi().createAddonMenu();\n if (e && e.authMode === ScriptApp.AuthMode.NONE) {\n // Add a normal menu item (works in all authorization modes).\n menu.addItem('Start workflow', 'startWorkflow');\n } else {\n // Add a menu item based on properties (doesn't work in AuthMode.NONE).\n const properties = PropertiesService.getDocumentProperties();\n const workflowStarted = properties.getProperty('workflowStarted');\n if (workflowStarted) {\n menu.addItem('Check workflow status', 'checkWorkflow');\n } else {\n menu.addItem('Start workflow', 'startWorkflow');\n }\n // Record analytics.\n UrlFetchApp.fetch('http://www.example.com/analytics?event=open');\n }\n menu.addToUi();\n}\n``` \n\nProperties\n\n| Property | Type | Description |\n|-------------------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `NONE` | `Enum` | A mode that does not allow access to any services that require authorization. This mode occurs when an add-on executes an `on``Open(e)` simple trigger, and the user has installed an add-on in a different document but the add-on has not been used in the current document. |\n| `CUSTOM_FUNCTION` | `Enum` | A mode that allows access to a limited subset of services for use in custom spreadsheet functions. Some of these services --- including read-only access to Spreadsheet service --- normally require authorization, but are permitted without authorization when used in a custom function. Because custom functions do not include an event parameter, this value is never returned; it is documented only to demonstrate that custom functions run in their own authorization mode. |\n| `LIMITED` | `Enum` | A mode that allows access to a limited subset of services. This mode occurs when an add-on or a script [bound](/apps-script/scripts_containers) to a document executes an `on``Open(e)` or `on``Edit(e)` simple trigger, except in the case described for `NONE`. |\n| `FULL` | `Enum` | A mode that allows access to all services that require authorization. This mode occurs when an add-on or a script executes as the result of any trigger other than the cases described for `LIMITED` or `NONE`. |"]]