Sub topic 7
Reviewing and revoking access
This chapter assumes you can already share a spreadsheet with named people, you know the Viewer, Commenter and Editor roles, and you understand the difference between Restricted and Anyone with the link general access. You need to be the owner or an editor with permission to manage access. Basic JavaScript helps for the scripting section.
Sharing is easy to do and easy to forget. Over months, a sheet collects collaborators who have left the project, links that were pasted into chats, and roles that were set higher than needed. Reviewing access regularly, and removing what is no longer needed, is the other half of sharing safely.
Where to see who has access
Open the spreadsheet and select Share. The dialog lists everyone with access, and each person shows a role. The owner is labeled Owner. Below the list, the General access section tells you whether the file is Restricted or open to anyone with the link, and which role link holders get.
The dialog shows a few kinds of entries:
- Individual people, identified by their Google account email.
- Groups, such as a Google Group or a Google Workspace group. A group appears as one row, even though it can contain many people.
- General access, which covers everyone who has the link (or everyone in your organization, if your organization offers that choice).
The Share dialog shows only people who were given access directly to this file. It does not always show everyone who can open the file. A person can also get access through a group, through a shared drive the file lives in, or through the folder that contains it. Keep this in mind when you review, because removing a person from the file does not help if they still have access through another path.
Checking more closely with Manage access
On some versions of the dialog, Manage access (or the entry for people with access) opens a fuller list. Use it to scan each row for three things:
- Roles that are higher than the person needs. An Editor who only reads the data should be a Viewer.
- People who have left the team or no longer need the file.
- External addresses, meaning accounts outside your organization, especially personal addresses you do not recognize.
Some Google Workspace editions also show a Details or activity view for a file. In Drive, select the file and open the Details panel (the "i" icon) to see an activity log and, for the file's location, the folder it sits in. The activity view helps answer "who shared this and when", which is useful before you remove someone.
Revoking access for a person
To remove one person:
- Select Share.
- Find the person in the list.
- Open the role drop-down next to their name and choose Remove access.
- Select Save.
The change takes effect for new requests right away. Anyone who has the sheet open at that moment may keep the page loaded for a short time, but they lose the ability to save edits and will see an access error when they reload.
To lower a role instead of removing access, choose a different role from the same drop-down, for example change Editor to Viewer. This is often the better choice for someone who should still read the data.
What revoking does not undo
Removing access stops future access. It does not take back anything the person already did or took:
- If they downloaded the data, or copied it into their own spreadsheet, those copies remain theirs.
- Edits they made stay in the sheet. Check File > Version history > See version history to see what they changed. You can restore an earlier version if needed.
- If they made a copy of the whole spreadsheet, that copy is a separate file they own, and you cannot remove it.
For this reason, limit what viewers and commenters can do before you share sensitive data. You can turn off downloading, printing and copying for them in the sharing settings. Do this ahead of time, because it will not help after the data has left.
Revoking link access
If the file is set to Anyone with the link, you cannot list everyone who has opened it. You can only close the door:
- Select Share.
- Under General access, open the drop-down that says Anyone with the link.
- Choose Restricted.
- Select Done.
After this, only people added by name can open the file. Anyone who holds the old link, and was not added, sees a request-access page.
There are some points to watch:
- Changing from Anyone with the link to Restricted also affects people who only had access through the link. If any of them still need access, add them by email first.
- If you want to keep link sharing but reduce harm, lower the link's role from Editor to Viewer instead of closing it.
- A link is not a password. If it was posted publicly, assume it was seen, and review the version history for unwanted edits.
Pending invitations and access requests
Two situations are easy to miss:
- Invitations sent to non-Google addresses. When you share with an address that does not have a Google account, the person may receive an invitation they use with a verification code. Their entry appears in the list like any other, and you remove it the same way.
- Access requests. When someone opens a restricted file, they can ask for access, and you receive an email. Approving the request grants the role you choose. Ignoring it grants nothing. Check that you pick the role deliberately, because the default shown in the email is not always the one you want.
Stopping editors from changing access
Reviewing is only reliable if people cannot quietly widen access behind your back. In the Share dialog, open the settings (the gear icon) and turn off Editors can change permissions and share. After that, only the owner can add people or change roles. This keeps your review list accurate between reviews.
A review routine
A short, repeatable routine is more effective than an occasional large cleanup.
| Step | What to check | Action |
|---|---|---|
| 1 | General access setting | Set to Restricted unless the link is intentionally public |
| 2 | Link role, if link sharing is on | Lower to Viewer or Commenter where possible |
| 3 | Each named person | Remove people who left, lower roles that are too high |
| 4 | External addresses | Confirm each one is expected |
| 5 | Groups | Confirm the group still has the right members |
| 6 | Editor permissions setting | Turn off editor resharing if you do not need it |
| 7 | Version history | Look for unexpected edits after any removal |
Choose how often to do this based on how sensitive the data is. A sheet with payroll or customer data justifies a monthly review. A shared team checklist may only need a review at the end of a project.
Reviewing access with Apps Script
For one file, the dialog is enough. For a file you review often, a script can list every person with direct access. This script is bound to the spreadsheet (open Extensions > Apps Script from the sheet). It writes the owner, editors, viewers and the link setting to the log.
function auditAccess() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const file = DriveApp.getFileById(ss.getId());
const owner = file.getOwner();
Logger.log('Owner: ' + (owner ? owner.getEmail() : 'none (shared drive)'));
ss.getEditors().forEach(function (user) {
Logger.log('Editor: ' + user.getEmail());
});
ss.getViewers().forEach(function (user) {
Logger.log('Viewer or commenter: ' + user.getEmail());
});
Logger.log('Link access: ' + file.getSharingAccess());
Logger.log('Link permission: ' + file.getSharingPermission());
}Two details matter here. First, getViewers() returns both viewers and commenters, so you cannot tell the two apart from this call. Use file.getViewers() and file.getEditors() on the Drive file for the same result, and check the Share dialog when the exact role matters. Second, the first time you run the script, Google asks you to authorize it. The script needs permission to see your Drive files.
To revoke access with a script, use the matching remove methods and close link sharing:
function revokeAccess() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const file = DriveApp.getFileById(ss.getId());
// Remove one person from both the Editor and Viewer lists.
ss.removeEditor('[email protected]');
ss.removeViewer('[email protected]');
// Close link sharing so only named people can open the file.
file.setSharing(DriveApp.Access.PRIVATE, DriveApp.Permission.NONE);
}DriveApp.Access.PRIVATE is the scripted form of Restricted. Calling removeEditor on someone who is not an editor does not cause harm, so the script is safe to run more than once. Running it does not cancel access that comes from a group or a shared drive. Those need to be changed at their source.
Common problems
- The person was removed but can still open the file. They probably have access through a group, a parent folder, or a shared drive. Check each, as the diagram shows.
- You cannot see the Remove access option. You may be a Viewer or Commenter, or an editor whose resharing was turned off. Ask the owner.
- The Share dialog lacks the setting you expect. Your organization may limit the options. Your administrator controls these.
- A removed person still appears in an old comment thread. Their past comments stay in the sheet. You can delete the comments if needed, but removing access does not delete them.
- You turned the link to Restricted and people complain. They were relying on the link. Add them by name with the correct role.
Exercise
A former team member was removed from the Share dialog of a budget sheet, but they can still open it. List three places you would check and what you would change in each.
Show answer
First, check whether they belong to a group that has access to the file, and if so remove them from the group. Second, check the folder that contains the file, or the shared drive it sits in, because permissions are inherited from there, and remove them from that folder or shared drive. Third, check General access. If it is set to Anyone with the link, they can open the file through the link, so change it to Restricted (and add anyone who still needs access by name).
Exercise
You find that a sheet shared with Anyone with the link has the Editor role. People only need to read it. What is the smallest change that fixes this without breaking their access, and what should you check afterwards?
Show answer
Change the link's role from Editor to Viewer, which keeps the link working for readers. Afterwards, open the version history to look for unexpected edits made while the link allowed editing, and turn off "Editors can change permissions and share" if you want to stop others from widening access again.