Sub topic 12
When your organization limits sharing
This chapter explains why some sharing options are missing, greyed out, or fail with an error when you use a Google Sheet through a work or school account. It assumes you know the Share dialog, the three roles (Viewer, Commenter, Editor), and the two general access settings (Restricted and Anyone with the link). It also assumes you know what a shared drive is. The scripting section needs basic JavaScript.
Why your options can differ from a tutorial
Everything earlier in this tutorial describes what Sheets can do. What you can do in your own account is that set of features, narrowed by the rules your organization has configured. Personal accounts (such as @gmail.com) mostly see the full feature set. Accounts managed by Google Workspace, a school, or another organization are governed by an administrator.
The administrator sets rules in the Admin console, under the Drive and Docs sharing settings. Those rules apply to every file in the organization, including every spreadsheet. A rule can:
- Remove an option from the dialog.
- Show a warning before you continue.
- Cause an action to fail after you attempt it.
Your role on a particular sheet (even Owner) does not override these rules. An owner can decide who gets access, but only within what the administrator allows.
The layers that decide what is possible
Think of sharing as a stack of filters. A request to share is allowed only if every layer allows it.
- Organization policy. The administrator's rules for the whole domain or for an organizational unit (a group of users, such as a department).
- Shared drive settings. If the sheet lives in a shared drive, the drive's own settings apply too.
- File settings. The owner's or editor's choices on the sheet, such as "Editors can change permissions and share".
- Your role. You need enough access on the sheet to change its sharing at all.
The most restrictive layer wins. If the organization forbids outside sharing, no file setting can reopen it.
Common organization-level controls
Administrators choose from a set of controls. The names in the Admin console change over time, so treat the following as a description of the categories.
| Control | What it does to you | What you will notice |
|---|---|---|
| Sharing outside the organization | Can be off, limited to allowlisted domains, or on | Typing an outside address is rejected, or only approved domains work |
| Warning for outside sharing | Adds a confirmation step | A warning appears when you add someone from another domain |
| Link sharing | May limit "Anyone with the link" to people inside the organization | The general access menu offers your organization but not "Anyone" |
| Publishing to the web | Can be disabled | File > Share > Publish to web is missing or fails |
| Sharing with non-Google accounts | Can permit or block invitations to people without a Google account | Outside recipients without accounts cannot be invited |
| Access Checker | Controls what happens when you share a link with people who lack access | The prompt may offer fewer choices |
| Receiving files from outside | Controls whether your users can accept files shared by other domains | Colleagues cannot open an outside sheet, or you cannot receive one |
Allowlisted domains
An administrator can allow outside sharing only with specific partner domains. Sharing with [email protected] may work while [email protected] is refused. The restriction is on the recipient's domain. It does not depend on the role you pick.
Link sharing narrowed to the organization
When the administrator limits link sharing, the general access menu shows your organization instead of "Anyone with the link". Anyone in the organization who has the link can use it at the role you set. This is the usual setup for internal sheets.
Publishing to the web
Publishing is a separate feature from sharing, and it has its own switch. An organization can allow sharing within the domain and still block publishing, because a published sheet is readable by anyone with the URL, with no sign-in. If you need a public, read-only view and the option is missing, the policy is the cause. Changing your file settings will not help.
Shared drives add their own limits
A sheet inside a shared drive inherits the drive's membership, and the drive carries its own settings. These typically cover:
- Whether people who are not members of the drive can be given access to individual files.
- Whether the drive's files can be shared outside the organization.
- Whether viewers and commenters can download, print, and copy.
- Whether members with the Manager role can change these settings, or only the administrator.
Two consequences follow:
- The ownership model differs. A file in a shared drive belongs to the drive and the organization. It does not belong to one person, so "transfer ownership" is not the right tool there. You change drive membership or the drive's settings.
- You cannot remove an inherited permission from the file alone. If someone has access because they are a drive member, you remove them from the drive, or you move the file to a different location.
Recognizing a policy block
Different symptoms point to different causes. Use them to decide whether to keep troubleshooting or contact your administrator.
| Symptom | Likely cause | What to do |
|---|---|---|
| "Anyone with the link" is not in the menu | Link sharing limited to the organization | Share with named people, or ask for an exception |
| An outside address is rejected | Outside sharing off, or that domain is not allowlisted | Ask the administrator to allowlist the domain |
| A warning appears when adding an outside person | Warning policy is on | Confirm if the share is intended |
| You can't change sharing on a sheet | Your role or the file setting prevents it | Ask the owner, or check the "Editors can change permissions" option |
| Sharing settings are greyed out in a shared drive | Drive settings or Manager restrictions | Ask a drive Manager or administrator |
| The Publish to web command is missing | Publishing disabled | Ask the administrator, or use a different way to distribute the data |
If a setting is missing for everyone in your team and is described correctly in this tutorial, the cause is almost always policy. Policies can also differ between organizational units, so a colleague in another department may see options you do not.
Scripts are subject to the same rules
Code that changes sharing goes through the same checks. A call such as setSharing or addViewer can fail if the policy forbids what you ask for. Write scripts that expect this, and read back the result.
function makeLinkViewOnlyIfAllowed() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const file = DriveApp.getFileById(ss.getId());
try {
file.setSharing(DriveApp.Access.ANYONE_WITH_LINK, DriveApp.Permission.VIEW);
} catch (e) {
Logger.log('Could not set link sharing: ' + e.message);
}
// Report what actually applies now, not what we asked for.
Logger.log('Access: ' + file.getSharingAccess());
Logger.log('Permission: ' + file.getSharingPermission());
}When the policy allows only organization-wide links, you can request that setting instead:
function shareWithOrganization() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const file = DriveApp.getFileById(ss.getId());
file.setSharing(DriveApp.Access.DOMAIN_WITH_LINK, DriveApp.Permission.VIEW);
}DOMAIN_WITH_LINK gives anyone in the domain who has the link the Viewer role. The exact result depends on your account type, so log getSharingAccess() after the call to confirm.
Working within the limits
Treat the policy as part of the design of your sheet.
- Share with the smallest audience that works. Named people are allowed in nearly every configuration, and they also give you the best audit trail.
- Use groups where permitted. Sharing with a group address means membership changes happen in one place, and it fits cleanly with organization controls.
- Check before promising. Before telling an outside partner they will get edit access, test with their address, or ask the administrator if the domain is allowed.
- Don't work around the policy. Copying data into a personal account to share it outside the organization may break your organization's rules. The policy exists to protect that data. Ask for an approved route instead.
- Plan for the shared drive. If your sheet will be shared widely, decide early whether it belongs in a shared drive. Moving a file later can change who has access, because the file starts to follow the drive's membership and settings.
Exercise
A colleague at your company shares a sheet link with you. You are the owner of another sheet and try to give a contractor at an outside domain Editor access, but the Share dialog rejects the address. Your teammate in a different department can add the same contractor without trouble. Name two layers that could explain the difference, and state who can fix each.
Show answer
The organization policy could differ between organizational units, so your unit may block outside sharing or not allowlist the contractor's domain, while your teammate's unit allows it. Only an administrator can change that, by allowlisting the domain or moving your unit's rule. Alternatively, the sheet may be in a shared drive whose settings block sharing outside the organization. A drive Manager or administrator can change that, or you can move the sheet to a location where it is allowed. Your own role as owner cannot override either layer.
Exercise
A script calls file.setSharing(DriveApp.Access.ANYONEWITHLINK, DriveApp.Permission.VIEW) and finishes without an obvious problem, but the sheet is still not reachable by link from outside. What should the script do differently?
Show answer
Wrap the call in try/catch to log any error, then read file.getSharingAccess() and file.getSharingPermission() afterward and log or return them. The policy may have blocked or changed the request, and the script should report what is actually in effect instead of assuming the call worked.