Slider

How To Share Google Drive Documents With View-Only Access.

Learn how to set Google Drive documents to View-Only, prevent edits, and use advanced sharing settings to secure and manage your files effectively.
Share Google Drive File With View Only Access

Google Drive is a powerful tool for storing and sharing files online, whether you're working on a project, organizing personal documents, or collaborating with others. But not every file needs to be edited by everyone. Sometimes, you just want to share a folder so others can view the contents without being able to change anything. That’s where view-only access comes in handy.

You can restrict any external user from editing your Google Drive document before sharing it for team activities or collaborations. To prevent accidental changes, you can also set the document to view-only mode for everyone, including yourself. 

Let's learn both methods to make our documents and files more secure and safe from any kind of accidental editing.

Share Google Drive Documents With View-Only Access.

To follow this tutorial, all you need is an active Google Account and a document which is already been created and uploaded to Google Drive.

Step 1: Open Google Drive.

To begin, open your preferred web browser and go to https://drive.google.com. If you're not already signed in, you’ll be prompted to log in to your Google account. Once signed in, you'll land on the Google Drive homepage, where all your stored files and folders are displayed.

Step 2: Locate the Document You Want to Share

Scroll through your list of files, or use the search bar at the top to quickly find the document you intend to share. Once you locate it, you can either right-click on the file and select “Share” or open the document first and then click the “Share” button located in the top-right corner of the screen.

Google Drive Document Sreenshot

Step 3: Share with Specific People as Viewers

In the sharing dialog box that appears, you will see a field labeled “Add people and groups.” Type the email address of the person or group you want to share the document with. After entering the email, a drop-down menu will appear where you can select their permission level. 

Choose “Viewer” to ensure they can only view the document, but cannot comment on or edit it. Once done, click the “Send” button to share the document with them.

Adding Email id to share Google Docs

Step 4: Share via a View-Only Link (Optional)

If you prefer to share the document via a link rather than individual email addresses, look toward the bottom of the sharing dialog box. Under “General access”, click the dropdown that may say “Restricted” by default. Change it to “Anyone with the link”.

Once you do that, another dropdown will appear beside it—make sure it is set to “Viewer.” Then click “Copy link” to copy the shareable URL and send it via email, chat, or wherever needed.

Sharing Google Drive Doc Link

Pro Tip:
 Before sending or sharing the link, always double-check the access level to make sure the document is not mistakenly being shared with editing or commenting privileges.

Alternative way to Set Everyone's Role To view-only access.

First, open the sharing settings for the document using the same steps described above. For each listed user, including yourself, make sure the access level is set to “Viewer.” Click the dropdown beside each name and manually change the role if needed. Once this is done, no one will be able to modify the document in any way, but they can only view its content.

Changing Document Role to Viewer

Change Editing To View-Only Access in Google Docs.

There might be a possible scenario that you have already provided Editor access to many users for one Google Document, and now you want to change all the access to Viewer (View-Only) access. You can follow the above method to change the access type for each user ID one at a time, or there is a quick alternative way to do so by using Google App Script.

Changing Google Drive Document Permission Using Google App Script.

Step 1: First, go to https://script.google.com and click on "New Project" to create a blank script editor. This is where you'll write the automation code. Inside the script editor, paste the following code:
function restrictEditingToViewOnly() {
  var fileId = 'YOUR_FILE_ID_HERE'; // Replace with your actual fileID
  var file = DriveApp.getFileById(fileId);
  
  var editors = file.getEditors();
  
  for (var i = 0; i < editors.length; i++) {
    var userEmail = editors[i].getEmail();
    file.removeEditor(userEmail);
    file.addViewer(userEmail);
    Logger.log("Changed " + userEmail + " to viewer.");
  }
  
  var myEmail = Session.getActiveUser().getEmail();
  if (myEmail !== file.getOwner().getEmail()) {
    file.removeEditor(myEmail);
    file.addViewer(myEmail);
    Logger.log("You (" + myEmail + ") are now a viewer.");
  } else {
    Logger.log("You are the owner transferring ownership manually if needed.");
  }
}

Step 2: Replace 'YOUR_FILE_ID_HERE' with the actual file ID from your Google Drive document URL. This ID is the long string found in the URL of the file, typically located between /d/ and /edit.
https://docs.google.com/document/d/1XiYBcFw4VTHOmaD1pMmMTNlt2btERcxe0us3pHR4D4tNs/edit?usp=sharing

Step 3: Give your Project a good name and click the Save icon to save your project with the Script.

Step 4: Now, click the Run button (the triangular ▶️ icon) to execute the function. The first time you run the script, Google will prompt you to review and authorize the required permissions. Click on Review Permissions.
Google Script App

Step 5: If you are running Google App Script for the first time, you will get a pop-up saying "Google hasn't verified this app." You need to click on "Advanced" to open the advanced settings, click on your Project name, and provide all the required permissions to run the app.
Advance Setting for Google App Script

Step 6: You need to give your script permission to access your Google Account and select the checkbox shown below so the script can make the required changes in your Google Drive Document settings. Click on Continue to save to proceed.
Google Drive Permission
Step 9: After the script runs, all existing editors will be converted to viewers, and your own access will be downgraded unless you are the owner.

Note: Google doesn't allow you to remove your own access if you're the owner. You must transfer ownership manually through the Drive UI.

Be cautious with this script, especially if you choose to remove your own editing access. If you're the file owner, Google will not allow you to remove your own access via script, and you must have to transfer ownership manually through the Drive interface. For safety, it is always recommended to test this script on a duplicate file first to avoid losing access to important content.
0

No comments

Post a Comment

both, mystorymag

DON'T MISS

Nature, Health, Fitness
© all rights reserved
made with by templateszoo