I recorded a macro using the traditional way (GUI) to protect a range. The following script was generated.
function protect() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.getRange('C:C').activate(); var protection = spreadsheet.getRange('C:C').protect(); protection.setDescription('test');};However, when I apply that macro on other sheets, anybody (say user X) can edit the range. When I check for the protected range, it shows that the owner and user X are permitted to edit. This shouldn't happen.
However, when I manually set permissions then everything works fine.
How to solve this?