Skip to content

馃悰(backend) block item delete by creator without access - #814

Open
NathanVss wants to merge 1 commit into
mainfrom
fix/delete-creator
Open

馃悰(backend) block item delete by creator without access#814
NathanVss wants to merge 1 commit into
mainfrom
fix/delete-creator

Conversation

@NathanVss

Copy link
Copy Markdown
Contributor

Purpose

Fix a broken access control issue in item deletion.

A user could delete an item they had created inside a folder shared with them, even after the owner had revoked their access. Because the delete permission relied on the creator field alone (an immutable historical reference), revoking the share left the delete ability intact. The user could then call DELETE /api/v1.0/items/<id>/ on a subfolder they once created and soft-delete the whole subtree, including files and folders added by the owner.

Changes

  • Gate the creator branch in Item.get_abilities on the user still holding editor access on the item. The ability is now lost as soon as access is revoked, consistent with the update permission.
  • Owner/admin deletion of content created by other users is unchanged.
  • Add API and model tests covering a creator whose access was revoked (denied) and a creator who keeps editor access (allowed).

Deleting an item relied on the creator field alone, which is an
immutable historical reference. A user could still delete an item
they created inside a shared folder after their access was revoked,
wiping the whole subtree including the owner's content.

Gate the creator branch on holding editor access so the ability is
lost as soon as access is revoked, matching the update permission.
@sonarqubecloud

Copy link
Copy Markdown

@NathanVss
NathanVss requested a review from kernicPanel August 28, 2026 10:34
@kernicPanel

Copy link
Copy Markdown
Collaborator

I think we should wait for #756 , or rebase this PR in top of it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants