Repository navigation
[WEB-10182] fix: check modify rights on API asset PATCH - #10311
Conversation
…date The public API upload confirmation now requires the same permission as the web app (can_modify_asset) and only marks the asset as uploaded.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
sriramveeraghanta
left a comment
There was a problem hiding this comment.
LGTM. Uses the same can_modify_asset as the web v2 views, and the other two PATCH handlers already filter by user_id.
The public API upload confirmation now requires the same permission as the web app (can_modify_asset) and only marks the asset as uploaded.
) The public API upload confirmation now requires the same permission as the web app (can_modify_asset) and only marks the asset as uploaded. (cherry picked from commit e25ac54)
Description
GenericAssetEndpoint.patchin the public API setis_uploadedfrom the request body on any asset the caller's project access reached, without thecan_modify_assetcheck the web API applies. A caller who could not modify an asset could still flip its upload state.can_modify_asset(the same helper the web API uses) and returns 403 otherwise.Behavior change:
{"is_uploaded": false}no longer un-confirms an asset; the request returns 204 and the asset is, or stays, uploaded.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
plane/tests/contract/api/test_generic_asset_patch_scope.py: a caller who cannot modify the asset gets 403; the uploader can confirm their own upload through the real POST-then-PATCH flow.test_generic_asset_project_scope.py: the last assertion of the existing member test now expects the asset to stay uploaded.References
Created with Claude Code