Sub topic 4
General access and link sharing
This chapter assumes you can already share a spreadsheet with named people and know what the Viewer, Commenter and Editor roles allow. It covers the second control in the Share dialog: general access. This setting decides who can open the file without being added by name.
The two settings in general access
The Share dialog has two parts. The top part lists named people and their roles. The bottom part is General access. It has two values:
- Restricted: only people listed in the top part can open the spreadsheet. They must sign in with the Google account you shared with.
- Anyone with the link: anyone who has the URL can open the spreadsheet. You pick one role for these people: Viewer, Commenter or Editor.
Restricted is the default for a new file. Named people and general access add together. If Ana is listed as an Editor and the link is set to Viewer, Ana still edits. A person gets the higher of the roles that apply to them.
Changing general access
- Open the spreadsheet and select Share.
- Under General access, open the drop-down that says Restricted.
- Choose Anyone with the link.
- Open the role drop-down on the right and choose Viewer, Commenter or Editor.
- Select Copy link, then Done.
To undo it, set the drop-down back to Restricted. Anyone who opened the file through the link loses access the next time they load it. Anyone you listed by name keeps their role.
Depending on your account type, the drop-down may also offer an option for your organization, such as "Anyone at Example Corp with the link". This limits link access to people signed in to accounts in your domain. It is a useful middle setting for internal files.
Choosing the link role
The link role is the part people most often get wrong. Pick the lowest role that does the job.
| Link role | What link holders can do | Typical use |
|---|---|---|
| Viewer | Read the sheet, and make their own copy unless you disabled it | Published price lists, schedules, reference data |
| Commenter | Read and add comments and suggestions | Collecting feedback on a draft |
| Editor | Change cells, add or delete sheets, and edit the file's content | Short-lived collaboration where you trust everyone who might get the link |
Editor link access carries the most risk. Anyone who receives the link, including through a forward or a screenshot of the address bar, can change or erase your data. Version history lets you recover from this, but it does not tell you who the person was if they were not signed in.
Signed-in and anonymous visitors
With Anyone with the link, visitors do not need a Google account. Signed-out visitors are anonymous. This has practical consequences:
- Edits made by an anonymous editor appear in version history under a generic name such as "Anonymous" with an animal icon, so you cannot tell who made them.
- You cannot revoke one anonymous person. You can only turn off link sharing, or change the file, for everyone.
- Notifications and comment replies cannot reach anonymous people by email.
With Restricted, every visitor is identified by their Google account. This is the only setting that gives you a per-person record.
The link is a secret
A link-shared spreadsheet is not listed publicly. Search engines do not find it unless the URL is posted somewhere they can read. But the URL works like a password: whoever holds it has the access. Treat it accordingly.
- Do not post an Editor link in a public chat, a ticket or a web page.
- Remember that forwarding a link gives access that you cannot see.
- If a link has spread further than you intended, switch to Restricted. The URL stays the same, so you cannot "rotate" a link. To get a new URL, make a copy of the file and share the copy. You will then need to delete or restrict the original.
Link behaviour you may not expect
Links to a single tab or range
A link can include a gid value for a tab, and a range. Copying a link with a specific tab selected sends people to that tab. This only changes where they land. It does not hide the other tabs. Anyone with access can click to any tab that is not hidden, and hidden tabs can be revealed by editors. To keep data private, put it in a different file.
The link role is a ceiling for the general audience, not for named people
You can set the link to Viewer and still give individual people Editor. This is the usual pattern for a file that is public to read but private to change.
Viewers can still copy
A Viewer with the link can choose File > Make a copy unless you turned off downloading, printing and copying for viewers and commenters in the sharing settings. Copying gives them their own file with all of the data, so link-sharing a sheet means you share its contents.
Sharing the copy link
If you want recipients to get their own version, change the end of the URL from /edit to /copy. They are prompted to create a copy and cannot alter your original:
Original link: https://docs.google.com/spreadsheets/d/FILE_ID/edit
Copy link: https://docs.google.com/spreadsheets/d/FILE_ID/copyThe person still needs at least Viewer access to the file for this to work, so it pairs with a Viewer link.
Setting the link role with Apps Script
You can set general access from a script bound to the spreadsheet. This sets Anyone with the link with the Viewer role:
function makeLinkViewOnly() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const file = DriveApp.getFileById(ss.getId());
file.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.VIEW);
}Other DriveApp.Access values include PRIVATE (Restricted) and DOMAIN_WITH_LINK. The permission argument can be VIEW, COMMENT or EDIT. The first time you run the script, Google asks you to authorize it to manage your Drive files.
Common problems
- Collaborators see "You need access". The file is Restricted and their account is not listed. They may also be signed in with a different Google account than the one you invited. Check the account shown in the top-right corner.
- The "Anyone with the link" option is missing. Your Google Workspace administrator may have disabled it, or the file lives in a shared drive with limited sharing. A later chapter covers these limits.
- The link works for you but not for a colleague. If the setting is limited to your organization, people outside the domain are blocked, even if they have the URL.
- Someone you removed can still open the file. Check whether general access is still set to Anyone with the link. Removing a named person does not remove link access.
Exercise
A spreadsheet has general access set to "Anyone with the link" as Viewer. Maria is listed by name as Editor. You change general access to "Restricted". What can Maria and a stranger who has the old URL do afterwards?
Show answer
Maria can still edit, because her named role does not depend on general access. The stranger sees a request access page and cannot open the file, because Restricted allows only people listed by name.
Exercise
You shared an Editor link in a group chat by mistake and someone may have forwarded it. Why can you not issue a new link for the same file, and what are two ways to limit the damage?
Show answer
The URL is built from the file ID, which does not change. You can set general access to Restricted so the link stops working for unlisted people, or lower the link role to Viewer. If you need a different URL, make a copy of the file and share the copy. You can then review version history to undo unwanted changes.