enum을 호출하려면 상위 클래스, 이름, 속성을 호출합니다. 예를 들면
SpreadsheetApp.ProtectionType.RANGE입니다.
// Remove all range protections in the spreadsheet that the user has permission
// to edit.
const ss = SpreadsheetApp.getActive();
const protections = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE);
for (const protection of protections) {
if (protection.canEdit()) {
protection.remove();
}
}
// Removes sheet protection from the active sheet, if the user has permission to
// edit it.
const sheet = SpreadsheetApp.getActiveSheet();
const protection = sheet.getProtections(SpreadsheetApp.ProtectionType.SHEET)[0];
if (protection?.canEdit()) {
protection.remove();
}
[[["이해하기 쉬움","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"]],["최종 업데이트: 2024-12-02(UTC)"],[[["`ProtectionType` is an enum used to specify whether you are working with sheet or range protection in Google Apps Script."],["It has two properties: `SHEET` and `RANGE`, that are used with the `getProtections()` method to retrieve the corresponding protections."],["You can use `ProtectionType` to remove or modify existing protections within your spreadsheet, given the necessary permissions."]]],[]]