A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/reference/drive/permission below:

Enum Permission | Apps Script

Enum Permission

Stay organized with collections Save and categorize content based on your preferences.

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.

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.)
const folder = 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 value to File.setSharing(accessType, permissionType) throws an exception if the type of file does not support it. EDIT Enum Users 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. 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 to File.setSharing(accessType, permissionType) throws an exception if the type of file does not support it. OWNER Enum The user owns the file or folder. This value can be returned, but passing it to File.setSharing(accessType, permissionType) throws an exception. ORGANIZER Enum Users who can organize files and folders within a shared drive. This value can be returned, but passing it to File.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 to File.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, but passing it to File.setSharing(accessType, permissionType) throws an exception unless it is set in combination with Access.ANYONE.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2024-12-02 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["`DriveApp.Permission` is an enum that represents the permissions granted to users for accessing files or folders, in addition to individually assigned permissions."],["You can use `DriveApp.Permission` properties like `VIEW`, `EDIT`, `COMMENT`, etc. to define access levels when setting sharing settings for files or folders."],["Calling an enum property involves using the parent class, name, and property, such as `DriveApp.Permission.VIEW`."],["While some properties like `OWNER`, `ORGANIZER`, `FILE_ORGANIZER`, and `NONE` can be returned, they cannot be used to set sharing permissions and will throw an exception."]]],["The `Permission` enum in DriveApp defines user access levels for files/folders. Key permissions include `VIEW` (view/copy), `EDIT` (edit, potentially share), and `COMMENT` (view, copy, comment). `OWNER`, `ORGANIZER`, and `FILE_ORGANIZER` are for ownership and shared drive organization. `NONE` indicates no permissions. `setSharing()` can define these permissions using `DriveApp.Permission.ENUM_NAME`, except for `OWNER`, `ORGANIZER`, `FILE_ORGANIZER`, and sometimes `NONE`. The `setSharing` method also accepts an `Access` type to define who these permissions apply to.\n"]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4