Skip to content
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

fix(trash): Fix deleting items from public share with write access #3604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

come-nc
Copy link
Contributor

@come-nc come-nc commented Feb 11, 2025

When no user in session, default to owner.

Fix #3544 hopefully.

@come-nc come-nc added the 3. to review Items that need to be reviewed label Feb 11, 2025
@come-nc come-nc self-assigned this Feb 11, 2025
Copy link

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

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

💚 thanks

Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

I don't think it makes sense. If an anonymous user deleted a file from a public share, then we should say so and not accuse the owner of the public share.
Maybe using a placeholder like "anonymous public user" would be better?

@come-nc
Copy link
Contributor Author

come-nc commented Feb 13, 2025

@kyteinsky Can you test the behavior when using '' instead of $owner?
It looks like the rest of the code considers deleted_by as optional.

@kyteinsky
Copy link

file_4 was deleted with '', file_5 with null
both have the same db state for deleted_by too

When no user in session, use an empty string as deleted_by, which shows
 as "Unknown" in the UI.

Signed-off-by: Côme Chilliet <[email protected]>
@come-nc come-nc force-pushed the fix/fix-move-to-trash-from-public-share branch from b293363 to 574c909 Compare February 13, 2025 13:55
@come-nc come-nc requested review from artonge and kyteinsky February 13, 2025 13:55
@come-nc
Copy link
Contributor Author

come-nc commented Feb 13, 2025

file_4 was deleted with '', file_5 with null both have the same db state for deleted_by too

The parameter is typed as string on groupfolders side, so I’m using ''.
I forced push a version using that instead of $owner.

@kyteinsky
Copy link

maybe we can also change the term "Unknown" to "Anonymous Public User" like @artonge suggested?
but it might affect deletions from a previous version where this field was not there and values are set to null by default on upgrade.
a third state may be useful here somehow: unknown, user and "anonymous".

Or "Unknown" is fine too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Items that need to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: Anonymous users cannot delete files in a publicly shared groupfolder
3 participants