Class PageProtection
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
পৃষ্ঠা সুরক্ষা অবচয়। Google পত্রকের নতুন সংস্করণে তৈরি স্প্রেডশীটগুলির জন্য, পরিবর্তে আরও শক্তিশালী Protection
ক্লাস ব্যবহার করুন৷ যদিও এই শ্রেণীটি বাতিল করা হয়েছে, এটি পত্রকের পুরানো সংস্করণের সাথে সামঞ্জস্যের জন্য উপলব্ধ রয়েছে।
Google পত্রকের পুরানো সংস্করণে সুরক্ষিত শীটগুলি অ্যাক্সেস এবং সংশোধন করুন৷
অপ্রচলিত পদ্ধতি
পদ্ধতি | রিটার্ন টাইপ | সংক্ষিপ্ত বিবরণ |
---|
add User(email)
| void | ব্যবহারকারীদের তালিকায় একজন ব্যবহারকারীকে যুক্ত করে যারা শীটটি সম্পাদনা করতে পারে, যদি এটি সুরক্ষিত থাকে। |
get Users()
| String[] | এই শীট সম্পাদনা করতে পারেন এমন ব্যবহারকারীদের ইমেল ঠিকানাগুলির একটি তালিকা প্রদান করে৷ |
is Protected()
| Boolean | শীটটিতে শীট সুরক্ষা সক্ষম আছে কিনা তা নির্দেশ করে৷ |
remove User(user)
| void | শীট সম্পাদনা করতে পারে এমন ব্যবহারকারীদের তালিকা থেকে একজন ব্যবহারকারীকে সরিয়ে দেয়। |
set Protected(protection)
| void | শীটের জন্য সুরক্ষা স্থিতি সেট করে। |
অপ্রচলিত পদ্ধতি
add User(email)
অবচয়। এই ফাংশনটি বাতিল করা হয়েছে এবং নতুন স্ক্রিপ্টগুলিতে ব্যবহার করা উচিত নয়৷
ব্যবহারকারীদের তালিকায় একজন ব্যবহারকারীকে যুক্ত করে যারা শীটটি সম্পাদনা করতে পারে, যদি এটি সুরক্ষিত থাকে।
// Add the "user@example.com" user to the list of users who can edit this sheet
const sheet = SpreadsheetApp.getActiveSheet();
const permissions = sheet.getSheetProtection();
permissions.addUser('user@example.com');
permissions.setProtected(true);
sheet.setSheetProtection(permissions);
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
email | String | ব্যবহারকারীর ইমেইল যোগ করতে হবে। |
এছাড়াও দেখুন
get Users()
অবচয়। এই ফাংশনটি বাতিল করা হয়েছে এবং নতুন স্ক্রিপ্টগুলিতে ব্যবহার করা উচিত নয়৷
এই শীট সম্পাদনা করতে পারেন এমন ব্যবহারকারীদের ইমেল ঠিকানাগুলির একটি তালিকা প্রদান করে৷
যদি শীট সুরক্ষা অক্ষম করা হয়, তাহলে এই কল দ্বারা প্রত্যাবর্তিত মান অর্থহীন৷
প্রত্যাবর্তন
String[]
— ব্যবহারকারীদের ইমেল ঠিকানার একটি অ্যারে যারা এই শীট সম্পাদনা করতে পারে।
is Protected()
অবচয়। এই ফাংশনটি বাতিল করা হয়েছে এবং নতুন স্ক্রিপ্টগুলিতে ব্যবহার করা উচিত নয়৷
শীটটিতে শীট সুরক্ষা সক্ষম আছে কিনা তা নির্দেশ করে৷
// Determine whether or not sheet protection is enabled
const sheet = SpreadsheetApp.getActiveSheet();
const permissions = sheet.getSheetProtection();
const isProtected = permissions.isProtected();
প্রত্যাবর্তন
Boolean
— শীটটিতে শীট সুরক্ষা সক্ষম আছে কিনা।
এছাড়াও দেখুন
remove User(user)
অবচয়। এই ফাংশনটি বাতিল করা হয়েছে এবং নতুন স্ক্রিপ্টগুলিতে ব্যবহার করা উচিত নয়৷
শীট সম্পাদনা করতে পারে এমন ব্যবহারকারীদের তালিকা থেকে একজন ব্যবহারকারীকে সরিয়ে দেয়।
// Remove the "user@example.com" user to the list of users who can edit this
// sheet
const sheet = SpreadsheetApp.getActiveSheet();
const permissions = sheet.getSheetProtection();
permissions.removeUser('user@example.com');
permissions.setProtected(true);
sheet.setSheetProtection(permissions);
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
user | String | ব্যবহারকারীর ইমেইল ঠিকানা অপসারণ. |
এছাড়াও দেখুন
set Protected(protection)
অবচয়। এই ফাংশনটি বাতিল করা হয়েছে এবং নতুন স্ক্রিপ্টগুলিতে ব্যবহার করা উচিত নয়৷
শীটের জন্য সুরক্ষা স্থিতি সেট করে।
// Enables sheet protection for this sheet
const sheet = SpreadsheetApp.getActiveSheet();
const permissions = sheet.getSheetProtection();
permissions.setProtected(true);
sheet.setSheetProtection(permissions);
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
protection | Boolean | শীট সুরক্ষা সক্ষম করতে true , শীট সুরক্ষা নিষ্ক্রিয় করতে false ৷ |
এছাড়াও দেখুন
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-12 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-12 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe \u003ccode\u003ePageProtection\u003c/code\u003e class is deprecated and should not be used in new scripts for spreadsheets created in the newer version of Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003eProtection\u003c/code\u003e class instead for newer Google Sheets for more powerful sheet protection features.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePageProtection\u003c/code\u003e provides methods to manage access and modifications to protected sheets in the older version of Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eDespite being deprecated, \u003ccode\u003ePageProtection\u003c/code\u003e remains available for compatibility with older Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eKey methods include adding/removing users with edit access, checking protection status, and setting protection status.\u003c/p\u003e\n"]]],[],null,["# Class PageProtection\n\nPageProtection\n\n\n**Deprecated.** For spreadsheets created in the newer version of Google Sheets, use the more powerful\n[Protection](/apps-script/reference/spreadsheet/protection) class instead. Although this class is deprecated, it remains available\nfor compatibility with the older version of Sheets.\n\nAccess and modify protected sheets in the older version of Google Sheets. \n\n### Deprecated methods\n\n| Method | Return type | Brief description |\n|----------------------------------------------------|-------------|------------------------------------------------------------------------------|\n| [addUser(email)](#addUser(String)) | `void` | Adds a user to the list of users who can edit the sheet, if it is protected. |\n| [getUsers()](#getUsers()) | `String[]` | Returns a list of the email addresses of the users who can edit this sheet. |\n| [isProtected()](#isProtected()) | `Boolean` | Indicates whether the sheet has sheet protection enabled or not. |\n| [removeUser(user)](#removeUser(String)) | `void` | Removes a user from the list of users who can edit the sheet. |\n| [setProtected(protection)](#setProtected(Boolean)) | `void` | Sets the protection status for the sheet. |\n\nDeprecated methods\n------------------\n\n### `add``User(email)`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nAdds a user to the list of users who can edit the sheet, if it is protected.\n\n```javascript\n// Add the \"user@example.com\" user to the list of users who can edit this sheet\nconst sheet = SpreadsheetApp.getActiveSheet();\nconst permissions = sheet.getSheetProtection();\npermissions.addUser('user@example.com');\npermissions.setProtected(true);\nsheet.setSheetProtection(permissions);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|----------|-------------------------------|\n| `email` | `String` | The email of the user to add. |\n\n#### See also\n\n- [removeUser(user)](#removeUser(String))\n\n*** ** * ** ***\n\n### `get``Users()`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nReturns a list of the email addresses of the users who can edit this sheet.\n\nIf sheet protection is disabled, the value returned by this call is meaningless.\n\n#### Return\n\n\n`String[]` --- An array of email addresses of users who can edit this sheet.\n\n*** ** * ** ***\n\n### `is``Protected()`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nIndicates whether the sheet has sheet protection enabled or not.\n\n```javascript\n// Determine whether or not sheet protection is enabled\nconst sheet = SpreadsheetApp.getActiveSheet();\nconst permissions = sheet.getSheetProtection();\nconst isProtected = permissions.isProtected();\n```\n\n#### Return\n\n\n`Boolean` --- Whether the sheet has sheet protection enabled or not.\n\n#### See also\n\n- [setProtected(protection)](#setProtected(Boolean))\n\n*** ** * ** ***\n\n### `remove``User(user)`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nRemoves a user from the list of users who can edit the sheet.\n\n```javascript\n// Remove the \"user@example.com\" user to the list of users who can edit this\n// sheet\nconst sheet = SpreadsheetApp.getActiveSheet();\nconst permissions = sheet.getSheetProtection();\npermissions.removeUser('user@example.com');\npermissions.setProtected(true);\nsheet.setSheetProtection(permissions);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|------------------------------------------|\n| `user` | `String` | The email address of the user to remove. |\n\n#### See also\n\n- [addUser(email)](#addUser(String))\n\n*** ** * ** ***\n\n### `set``Protected(protection)`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nSets the protection status for the sheet.\n\n```javascript\n// Enables sheet protection for this sheet\nconst sheet = SpreadsheetApp.getActiveSheet();\nconst permissions = sheet.getSheetProtection();\npermissions.setProtected(true);\nsheet.setSheetProtection(permissions);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------|-----------|-------------------------------------------------------------------------|\n| `protection` | `Boolean` | `true` to enable sheet protection, `false` to disable sheet protection. |\n\n#### See also\n\n- [isProtected()](#isProtected())"]]