Enum ProtectionType
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Тип защиты Перечисление, представляющее части электронной таблицы, которые можно защитить от изменений.
Чтобы вызвать перечисление, вы вызываете его родительский класс, имя и свойство. Например, 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();
}
Характеристики
Свойство | Тип | Описание |
---|
RANGE | Enum | Защита диапазона. |
SHEET | Enum | Защита для листа. |
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2024-09-17 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Отсутствует нужная мне информация"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Слишком сложен/слишком много шагов"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Устарел"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Проблема с переводом текста"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Проблемы образцов/кода"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Другое"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Прост для понимания"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Помог мне решить мою проблему"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Другое"
}]
{"lastModified": "\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435: 2024-09-17 UTC."}
[[["Прост для понимания","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-09-17 UTC."]]