Search code examples
google-apps-scriptwiki

Programmatically Share Editing Rights of Google Site using a Google Form (Semi-Public Wiki)


I have an existing (classic) Google Site that I would like to be a semi-public wiki. Google seems to have explicitly disallowed public wikis in the new version of sites, so I'm trying to find a work-around of sorts.

Here's my ideal flow:

1. Guest visits my Google site "Foo Wiki" and clicks a link to become a contributor.

2. Link goes to my Google Form "Registration Form" that just asks for
   a name and email address.

3. Form submission creates a new line in a google sheet "Registration List".

4. "Registration List" has a script that emails the user's given email address 
    giving them editing rights to "Foo Wiki"

Is this possible?

I have the easy parts (1-3) done, but not sure how to go about step 4.


Solution

  • I think you can easily get this done using the addEditor() api.

    Kindly check this out https://developers.google.com/apps-script/reference/sites/site#addEditor(User)