SHARE
TWEET

Untitled

a guest Jul 21st, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Add editor to folder
  2. function example51() {
  3.   var folder = DriveApp.createFolder("EXAMPLE51");
  4.   folder.addEditor('brgablog@gmail.com');
  5. }
  6.  
  7. //Add editors to folder & don't allow them to share it
  8. function example52() {
  9.   var folder = DriveApp.createFolder("EXAMPLE52");
  10.   folder.addEditors(['brgablog@gmail.com',
  11.                      'roberts.barrie@gmail.com']);
  12.   folder.setShareableByEditors(false);
  13. }
  14.  
  15. //Remove editor from folder
  16. function example53() {
  17.   var folder = DriveApp.createFolder("EXAMPLE53");
  18.   folder.addEditors(['brgablog@gmail.com',
  19.                      'roberts.barrie@gmail.com']);
  20.   folder.removeEditor('brgablog@gmail.com');
  21. }
  22.  
  23. //Add viewer to folder
  24. function example54() {
  25.   var folder = DriveApp.createFolder("EXAMPLE54");
  26.   folder.addViewer('brgablog@gmail.com');
  27. }
  28.  
  29. //Set access to Anyone with a link, and with Edit rights
  30. function example55() {
  31.   var folder = DriveApp.createFolder("EXAMPLE55");
  32.   folder.setSharing(DriveApp.Access.ANYONE_WITH_LINK,
  33.                     DriveApp.Permission.EDIT);
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top