Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permissions to view/edit volunteer spreadsheet when new user joins data team slack #11

Open
jlegrone opened this issue Jan 28, 2016 · 1 comment

Comments

@jlegrone
Copy link
Contributor

This will only work for email addresses connected to google accounts.

@jlegrone jlegrone changed the title Add permissions to view/edit volunteer spreadsheet when new google user joins data team slack Add permissions to view/edit volunteer spreadsheet when new user joins data team slack Jan 28, 2016
@jeffomatic
Copy link

@jlegrone I made a Google Apps script that grants edit privileges to members of a Slack team:

https://gist.github.com/jeffomatic/6cdc3a7c40df61da1986

I would recommend trying this out on a test spreadsheet before rolling it out to the actual spreadsheet.

To install:

  • Upload the script:
    • Open the spreadsheet.
    • Go to Tools > Script editor.
    • Paste the script into the editor and save.
  • Set the Slack token
    • Get an an API token for the Slack team. This API token only needs read access to the team.
    • From the script editor, go to File > Project properties > Script properties.
    • Add a new row. The key is slackToken. Paste the API token string as the value.
  • Set a script trigger to run the syncSlackTeam function at whatever interval you choose. Every 5 minutes should probably suffice.

Notes:

  • It should silently ignore email addresses that do not have an associated Google Drive account.
  • It grants edit privileges to members of the Slack team who do not already have edit privileges.
  • It doesn't keep any state, so if you remove somebody's edit privileges, but they are a member of the Slack team, their edit privileges will be restored the next time the script is run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants