There are times when you might just want to share a user on a published Google Site as a part of a Google Apps Script Automation. Say you have an internal Google Site for a project and you want to share it with a member as a part of the onboarding process. Alternatively, you might want to share your site as soon as you receive a Stripe payment webhook ping.
To share a user in Google Sites you need to select the share icon from the top menu of the site editor. Then in the dialogue box add the user’s email and choose Published Viewer.
While there is no specific Google Apps Script API to manage Google Sites, we can share permissions and accessibility with Google Drive.