Last active
April 2, 2021 15:10
-
-
Save barrieroberts/9e5b98a522d2cf661f43c132bf581ab9 to your computer and use it in GitHub Desktop.
5-Add & remove editors from folder & file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add editor to folder | |
function example51() { | |
const folder = DriveApp.createFolder("EXAMPLE51"); | |
folder.addEditor('brgablog1@gmail.com'); | |
} | |
//Add editors to folder & don't allow them to share it | |
function example52() { | |
const folder = DriveApp.createFolder("EXAMPLE52"); | |
folder.addEditors(['brgablog1@gmail.com', | |
'brgablog2@gmail.com']); | |
folder.setShareableByEditors(false); | |
} | |
//Remove editor from folder | |
function example53() { | |
const folder = DriveApp.createFolder("EXAMPLE53"); | |
folder.addEditors(['brgablog1@gmail.com', | |
'brgablog2.com']); | |
folder.removeEditor('brgablog2@gmail.com'); | |
} | |
//Add viewer to folder | |
function example54() { | |
const folder = DriveApp.createFolder("EXAMPLE54"); | |
folder.addViewer('brgablog1@gmail.com'); | |
} | |
//Set access to Anyone with a link, and with Edit rights | |
function example55() { | |
const folder = DriveApp.createFolder("EXAMPLE55"); | |
folder.setSharing(DriveApp.Access.ANYONE_WITH_LINK, | |
DriveApp.Permission.EDIT); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment