-
-
Notifications
You must be signed in to change notification settings - Fork 480
Dialog for when the user is about to share a resource publicly #1751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
6fa1947
to
2a304a3
Compare
return await mainSession.loadDoc(`/doc/${docId}`, options); | ||
} | ||
|
||
async function checkAccessDenied(user: gu.UserData) { |
There was a problem hiding this comment.
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
andanon
as a prerequisite for the tests, maybe that's a bit overkill
f4813bc
to
4f19ee9
Compare
app/client/ui/UserManager.ts
Outdated
() => onConfirm(ctl, new Set([...acceptedWarnings, "public-sharing"])), | ||
{ | ||
explanation: ( | ||
markdown(t(`Your {{resourceType}} will be accessible to anyone \ |
There was a problem hiding this comment.
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?
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>
890489e
to
af51757
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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? |
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?
Screenshots / Screencasts
recording.mp4