Enum Access Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
Accessenum represents classes of users who can access a file or folder in Google Drive.To use an
Accessenum, you callDriveApp.Accessfollowed by the specific access property, such asDriveApp.Access.ANYONE.The available
Accessproperties includeANYONE,ANYONE_WITH_LINK,DOMAIN,DOMAIN_WITH_LINK, andPRIVATE.ANYONEandANYONE_WITH_LINKallow access without sign-in, whileDOMAIN,DOMAIN_WITH_LINK, andPRIVATErequire sign-in.Domain administrators can restrict the
ANYONEandANYONE_WITH_LINKsettings for Google Workspace users.
An enum representing classes of users who can access a file or folder, besides any individualusers 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.Access.ANYONE.
// Creates a folder that anyone on the Internet can read from and write to.// (Domain administrators can prohibit this setting for users of a Google// Workspace domain.)constfolder=DriveApp.createFolder('Shared Folder');folder.setSharing(DriveApp.Access.ANYONE,DriveApp.Permission.EDIT);
Properties
| Property | Type | Description |
|---|---|---|
ANYONE | Enum | Anyone on the Internet can find and access. No sign-in required. Domain administrators can prohibit this setting for users of a Google Workspace domain. Ifthe setting is disabled, passing this value to |
ANYONE_WITH_LINK | Enum | Anyone who has the link can access. No sign-in required. Domain administrators can prohibit this setting for users of a Google Workspace domain. Ifthe setting is disabled, passing this value to |
DOMAIN | Enum | People in your domain can find and access. Sign-in required. This setting is available only for users of a Google Workspace domain. For other types ofGoogle accounts, passing this value to |
DOMAIN_WITH_LINK | Enum | People in your domain who have the link can access. Sign-in required. This setting is available only for users of a Google Workspace domain. For other types ofGoogle accounts, passing this value to |
PRIVATE | Enum | Only people explicitly granted permission can access. Sign-in required. |
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.