Enum ProtectionType

ProtectionType

स्प्रेडशीट के उन हिस्सों को दिखाने वाला एन्युमेशन जिन्हें बदलाव करने से सुरक्षित किया जा सकता है.

किसी Enum को कॉल करने के लिए, आपको उसकी पैरंट क्लास, नाम, और प्रॉपर्टी को कॉल करना होता है. उदाहरण के लिए, SpreadsheetApp.ProtectionType.RANGE.

// Remove all range protections in the spreadsheet that the user has permission to edit.
var ss = SpreadsheetApp.getActive();
var protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
for (var i = 0; i < protections.length; i++) {
  var protection = protections[i];
  if (protection.canEdit()) {
    protection.remove();
  }
}
// Removes sheet protection from the active sheet, if the user has permission to edit it.
var sheet = SpreadsheetApp.getActiveSheet();
var protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0];
if (protection && protection.canEdit()) {
  protection.remove();
}

प्रॉपर्टी

प्रॉपर्टीTypeब्यौरा
RANGEEnumकिसी रेंज के लिए सुरक्षा.
SHEETEnumशीट के लिए सुरक्षा.