Skip to content

Conversation

fflorent
Copy link
Collaborator

@fflorent fflorent commented Aug 6, 2025

Context

The user may not understand the consequences of sharing publicly a resource, especially a doc.

Proposed solution

This confirmation dialog is meant to ask them to be sure the document does not contain sensitive data before sharing, and draw attention about the consequences.

It appears only when the resource is newly publicly shared (i.e. it does not appear if we change the permissions to everyone).

Related issues

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this is not relevant here
  • 🙋 no, because I need help

Screenshots / Screencasts

recording.mp4

@fflorent fflorent moved this to Needs feedback in French administration Board Aug 6, 2025
@fflorent fflorent marked this pull request as ready for review August 7, 2025 10:33
@fflorent fflorent requested a review from Copilot August 7, 2025 10:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a confirmation dialog that appears when users are about to share a resource publicly for the first time. The dialog warns users to check for sensitive data before making their document accessible to anyone with the link.

Key changes:

  • Adds a new confirmation dialog for public sharing that warns about sensitive data exposure
  • Refactors user management functions to support both organization and document-level permissions
  • Creates comprehensive test coverage for the new dialog functionality

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/nbrowser/gristUtils.ts Refactors user management functions to support document-level ACL operations and adds 'everyone' test user
test/nbrowser/UserManager.ts Adds comprehensive tests for document sharing functionality including the new confirmation dialog
app/common/ResourceTypes.ts Defines ResourceType union type for different resource categories
app/client/ui/UserManager.ts Implements the public sharing confirmation dialog with warning message
app/client/models/UserManagerModel.ts Adds logic to detect when public sharing is being enabled for the first time

@fflorent fflorent force-pushed the warn-sharing-publicly branch from 6fa1947 to 2a304a3 Compare August 7, 2025 12:54
return await mainSession.loadDoc(`/doc/${docId}`, options);
}

async function checkAccessDenied(user: gu.UserData) {
Copy link
Collaborator Author

@fflorent fflorent Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this function makes the tests much slower (each of them takes around 8s). I hope it is still acceptable for you.

Alternatively, I can:

  • try to use the API call instead, but I would need help;
  • avoid checking the access for user2, user3 and anon as a prerequisite for the tests, maybe that's a bit overkill

@fflorent fflorent force-pushed the warn-sharing-publicly branch from f4813bc to 4f19ee9 Compare September 2, 2025 17:24
@manuhabitela manuhabitela self-requested a review September 24, 2025 14:09
@manuhabitela manuhabitela moved this from Needs feedback to Needs Internal Feedback in French administration Board Sep 24, 2025
() => onConfirm(ctl, new Set([...acceptedWarnings, "public-sharing"])),
{
explanation: (
markdown(t(`Your {{resourceType}} will be accessible to anyone \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please run npm run generate:translation
and verify that your new strings are correctly collected
and add the modification to your PR?

fflorent and others added 6 commits October 1, 2025 13:21
The user may not understand the consequences of sharing publicly a
resource, especially a doc.
This confirmation dialog is meant to ask them to be sure the document
does not contain sensitive data before sharing.
This modal is meant to manage user access to resources.
For now, only doc access is tested.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fflorent fflorent force-pushed the warn-sharing-publicly branch from 890489e to af51757 Compare October 1, 2025 11:21
Copy link
Collaborator

@hexaltation hexaltation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fflorent fflorent moved this from Needs Internal Feedback to Needs feedback in French administration Board Oct 6, 2025
@paulfitz
Copy link
Member

paulfitz commented Oct 8, 2025

The language of the warning may suggest to a user that sharing a document will list it in search engines. Some websites make an active effort to get "user generated content" indexed by search engines by making easily consumed lists of such material for crawling. The reality of sharing for Grist is different, including a "noindex" meta element inserted in most document pages.

Screenshot from 2025-10-08 10-45-31

Of course search engines can find documents in all sorts of ways as users paste the url here and there, and can ignore directives, so the warning has merit.

Have you looked at the language used by other services that use link-sharing with the security dependent entirely on a secret in the url?

@fflorent
Copy link
Collaborator Author

fflorent commented Oct 8, 2025

Have you looked at the language used by other services that use link-sharing with the security dependent entirely on a secret in the url?

No, we have instead worked together with members of our team to phrase this modal dialog to make the warning as clear and as meaningful possible.

Should I take a look?

@fflorent
Copy link
Collaborator Author

@paulfitz I am open to other proposals (cc @nbush).
Please note that it's rather important to us to mention the risk with search engines, and our security teams raise a warning about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Needs feedback

Development

Successfully merging this pull request may close these issues.

3 participants