D
D
dollar2020-01-30 10:42:01
JavaScript
dollar, 2020-01-30 10:42:01

Whether it is possible in a normal way to forbid to edit everything, except for a range?

For example, disable the entire workbook or at least the entire sheet, but open a single cell or range.

Now, if two ranges overlap, the deny priority is higher. Thus, if you disable the entire sheet, then no allowable ranges work. You have to do something like this:

spoiler
5e3285aa20e48842166308.png

Those. we split the sheet into non-overlapping ranges, and then we protect them separately.

In addition, with this method, the editor still has the ability to insert new columns, change the column width, add new sheets. And if the editor is removed from the list of those who have access to the table, then by some miracle access will remain for reading (there is no access by link) due to the fact that the editor remains in some range.

It turns out quite strange:
1) On the one hand, you can not create new ranges (permissive), which overlap the higher (prohibitive). Will be comfortable.
2) On the other hand, when it comes to the most important thing - access to the document in general, it suddenly turns out that there is still access priority, although here it is no longer needed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
profesor08, 2019-05-06
@archi_kud

Well, look, when you drag some element, the mouse moves and continues to create events. So when, when dragging, it enters the card area, move it down (margin-top). When releasing the click, remove the shift and insert the element in front of the card. All.

A
Alexander Ivanov, 2020-01-31
@dollar

You can protect the sheet and add exclusions to the sheet protection, rather than adding a "permissive" range.
For example, you cannot create a new sheet or change the structure of the current sheet, but you can edit A1 https://docs.google.com/spreadsheets/d/1nleri9Tedl...
In my projects, I make scripts that handle several layers of protection well. It's much faster than by hand.

/**
 *
 * @param {GoogleAppsScript.Spreadsheet.Sheet} sheet
 */
function protectSheet_(sheet) {
  var protection = sheet.protect().setDescription('Autoprotection');
  var unprotected = sheet.getRangeList(getCommonNotasList_()).getRanges();
  protection.setUnprotectedRanges(unprotected);

  var me = Session.getEffectiveUser();
  protection.addEditor(me);
  protection.removeEditors(protection.getEditors());
  protection.addEditors(editors);
  if (protection.canDomainEdit()) protection.setDomainEdit(false);
};

var getCommonNotasList_ = function() {
  var a1Notations = [
    'B2:B4',
    'B6:B7',
    'A14:E30',
    'I3:Q26',
    'S2:V21',
    'T33:W264'
  ];
  return a1Notations;
};

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question