Enum Permission Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
Permissionenum represents the permissions granted to users for accessing files or folders in Google Drive.Permissions can be accessed using
DriveApp.Permission.The
Permissionenum includes properties likeVIEW,EDIT,COMMENT,OWNER,ORGANIZER,FILE_ORGANIZER, andNONE, each defining a specific level of access or role.Some
Permissionvalues likeOWNER,ORGANIZER,FILE_ORGANIZER, andNONE(unless combined withAccess.ANYONE) can be returned to indicate current permissions but cannot be set directly usingsetSharing.
An enum representing the permissions granted to users who can access a file or folder, besidesany individual users who have been explicitly given access. These properties can be accessed fromDrive.
To call an enum, you call its parent class, name, and property. For example,DriveApp.Permission.VIEW.
// Creates a folder that anyone on the Internet can read from and write to.// (Domain administrators can prohibit this setting for Google Workspace users.)constfolder=DriveApp.createFolder('Shared Folder');folder.setSharing(DriveApp.Access.ANYONE,DriveApp.Permission.EDIT);
Properties
| Property | Type | Description |
|---|---|---|
VIEW | Enum | Users who can access the file or folder are able only to view it or copy it. Passing this valuetoFile.setSharing(accessType, permissionType) throws an exception if the type of filedoes not support it. |
EDIT | Enum | Users who can access the file or folder are able to edit it. UnlessFile.setShareableByEditors(shareable) is set tofalse, users can also change the sharingsettings. Passing this value toFile.setSharing(accessType, permissionType) throws anexception if the type of file does not support it. |
COMMENT | Enum | Users who can access the file or folder are able only to view it, copy it, or comment on it.Passing this value toFile.setSharing(accessType, permissionType) throws an exception ifthe type of file does not support it. |
OWNER | Enum | The user owns the file or folder. This value can be returned, but passing it toFile.setSharing(accessType, permissionType) throws an exception. |
ORGANIZER | Enum | Users who can organize files and folders within a shared drive. This value can be returned, butpassing it toFile.setSharing(accessType, permissionType) throws an exception. |
FILE_ORGANIZER | Enum | Users who can edit, trash, and move content within a shared drive. This value can be returned,but passing it toFile.setSharing(accessType, permissionType) throws an exception. |
NONE | Enum | The user does not have any permissions for the file or folder. This value can be returned, butpassing it toFile.setSharing(accessType, permissionType) throws an exception unless itis set in combination withAccess.ANYONE. |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.