Enum Permission

Permission

An enum representing the permissions granted to users who can access a file or folder, besides any individual users who have been explicitly given access. These properties can be accessed from DriveApp.Permission.

 // Creates a folder that anyone on the Internet can read from and write to. (Domain
 // administrators can prohibit this setting for G Suite users.)
 var folder = DriveApp.createFolder('Shared Folder');
 folder.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT);
 

Properties

PropertyTypeDescription
VIEWEnumUsers who can access the file or folder are able only to view it or copy it. Passing this value to File.setSharing(accessType, permissionType) throws an exception if the type of file does not support it.
EDITEnumUsers who can access the file or folder are able to edit it. Unless File.setShareableByEditors(shareable) is set to false, users can also change the sharing settings. Passing this value to File.setSharing(accessType, permissionType) throws an exception if the type of file does not support it.
COMMENTEnumUsers who can access the file or folder are able only to view it, copy it, or comment on it. Passing this value to File.setSharing(accessType, permissionType) throws an exception if the type of file does not support it.
OWNEREnumThe user owns the file or folder. This value can be returned, but passing it to File.setSharing(accessType, permissionType) throws an exception.
ORGANIZEREnumUsers who can organize files and folders within a Team Drive. This value can be returned, but passing it to File.setSharing(accessType, permissionType) throws an exception.
NONEEnumThe user does not have any permissions for the file or folder. This value can be returned, but passing it to File.setSharing(accessType, permissionType) throws an exception unless it is set in combination with Access.ANYONE.

Send feedback about...

Apps Script
Apps Script