title: Allow users to duplicate Google Spreadsheet sheet but maintain its parent's permissions
body: <h3>Short</h3>
  
  <p>I need to allow users of my Google spreadsheet to duplicate a sheet/tab with restricted ranges, and maintain those restrictions in the copy. Is this possible, given that they will be the 'owner' of the copied sheet/tab (although not the whole spreadsheet and script)?</p>
  
  <h3>Long</h3>
  
  <p>I have created a shared spreadsheet containing a template sheet/tab with carefully protected ranges. Other users need to duplicate that sheet/tab but still have edit access only to the unprotected ranges.</p>
  
  <p>When a Google spreadsheet sheet/tab is normally duplicated, its range protections do not copy over. The solution to this is suggested here: <a href="https://stackoverflow.com/questions/27607651/how-to-duplicate-a-sheet-with-protected-ranges">How to duplicate a sheet with protected ranges?</a></p>
  
  <p>However, while this script works beautifully for me (as owner) it fails when other users run it. Either they can edit the restricted ranges on the copy (because they made it), or, if I try to remove their edit rights in the script, it fails for them when they run it with "you do not have permission to perform that action".</p>
  
  <p>My initial work-around was to write into the script a temporary suspension of all permissions at the level of the entire Spreadsheet to allow the script to run, duplicate, remove their range permissions, and then remove their Spreadsheet permissions. </p>
  
  <p>The problem is this (and many variations on it) do not work, throwing up the same error message to the user ("you do not have permission...").</p>
  
  <p>A different approach was to get the script to copy the sheet and then apply the range restrictions. That failed too, and I note that the Google script documentation for removeEditor() states "Neither the owner of the spreadsheet nor the current user can be removed". </p>
  
  <p>I further note that another author identifies essentially the same issue as I am having: <a href="https://webapps.stackexchange.com/questions/95751/google-sheets-script-to-add-protection-and-remove-the-user-running-it">https://webapps.stackexchange.com/questions/95751/google-sheets-script-to-add-protection-and-remove-the-user-running-it</a></p>
  
  <p>Is this what is breaking it? If so, is there a work-around? Am I misunderstanding some (quite fundamental) details of Google's sharing modal?</p>
  
  <p>I also appreciate that writing a script to explicitly (if temporarily) suspend the permissions written into the spreadsheet is obtuse, but this is (so far as I am aware) the only way to achieve the ultimate goal of users duplicating sheets whilst maintaining their range protections. Is there another solution?</p>