You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
After copying a spreadsheet using client.copy and then opening the new sheet using client.open, the protected ranges are still correctly defined as in the source spreadsheet; however, the Editors for the protected ranges have been changed to just myself.
Describe the solution you'd like
I would like to be able to add the other users that had edit rights to protected ranges on the new sheet.
Describe alternatives you've considered
I've considered deleting and redefining the protected ranges so more than one editor can be added; but that seems like it's not needed.
I checked and I confirmed the protected ranges are not copied over to the new spreadsheet.
I can work that out and add a new option to the copy method and offers to copy the protected ranges. This will be costly though. Much like the other (already existent) options, we need to list all protected ranges then created them by batch (if the API allows it by batch, otherwise it will be one by one).
Hi @tompbarry
I had a look at this issue, I have a draft code that does the job but the API has some issues.
When sending the request to create the new protected ranges it fails, every time I try to copy the original protected range to the new sheet, the new sheets ends up with 2 protected ranges, one that has an issue and we can't delete it/edit it, the other one that is only read-only.
I am removing this issue from the next milestone as I have no idea how to counter that problem for now.
I will keep track of that and keep testing.
Is your feature request related to a problem? Please describe.
After copying a spreadsheet using client.copy and then opening the new sheet using client.open, the protected ranges are still correctly defined as in the source spreadsheet; however, the Editors for the protected ranges have been changed to just myself.
Describe the solution you'd like
I would like to be able to add the other users that had edit rights to protected ranges on the new sheet.
Describe alternatives you've considered
I've considered deleting and redefining the protected ranges so more than one editor can be added; but that seems like it's not needed.
The com.google.api.services.sheets.v4.model contains a Class Editors that appears to allow additions/removal of editors for protected ranges as shown at https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets#Editors
Google Apps Script also contains an addEditor https://developers.google.com/apps-script/reference/spreadsheet/protection?hl=en#addeditorsemailaddresses function for protected ranges.
Additional context
The text was updated successfully, but these errors were encountered: