Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Google Apps Script for Beginners

You're reading from  Google Apps Script for Beginners

Product type Book
Published in Feb 2014
Publisher
ISBN-13 9781783552177
Pages 178 pages
Edition 1st Edition
Languages
Author (1):
Serge Gabet Serge Gabet
Profile icon Serge Gabet

Table of Contents (16) Chapters

Google Apps Script for Beginners
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Enhancing Spreadsheets 2. Create and Manipulate Forms 3. Managing an E-mail Account 4. Embedding Scripts in Text Documents 5. Embedding Scripts in Google Sites 6. Standalone Web Applications / User Interfaces 7. Using User Interfaces in Spreadsheets and Documents 8. How to Expand your Knowledge 9. Conclusion Index

Limiting user access


Let us return for a while to publishing web apps, which we explored at the very beginning of this chapter: we saw that we could deploy them to run as myself and used by either Anyone or only me.

That's actually the first level of access limitation, but sometimes we would like to give access to some people we know and prevent everyone else from using it; this basic limitation is definitely too basic.

There are a few ways to get the result we want; the following are two simple examples.

When we deploy an app as User accessing the web app, the user will be asked to authorize the script to get his e-mail address (or more information if the app uses other Google services) and information about who is using it.

In this case, we can easily place a condition on this e-mail address for it to be compared to the list of authorized users. The following code for this is very simple:

var email = Session.getEffectiveUser().getEmail();
var client = ['serge@gmail.com','mary@yahoo.com','william...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}