SIGN IN SIGN UP

Preserve "View as" for attachment previews and doc exports (#2478)

Attachment previews (widget/editor) and the share menu's whole-doc XLSX
export fetch DocApi URLs that build a fresh docSession from the request
URL. They dropped the aclAsUser_ link parameter, so they resolved as the
owner instead of the impersonated user.

Expose BaseAPI extraParameters to the URL builders, and build these URLs
through a View-as-aware DocAPI.

Uploads need no special-casing: the /uploads route is not doc-access
controlled, and the real gating happens on the socket calls that follow
(addAttachments, UpdateRecord), which already carry the View-as context.
So the widget/editor just use one View-as-aware DocAPI throughout; the
param is inert on the upload path. MakeCopyMenu's full-doc downloads
pass no such context, so copies stay unfiltered.

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
P
Paul Fitzpatrick committed
d806090fcffcff332a3f49bc2005ca4be9d3f530
Parent: 0635aa4
Committed by GitHub <noreply@github.com> on 7/24/2026, 5:32:03 PM