Skip to content

[WEB-10182] fix: check modify rights on API asset PATCH - #10311

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10182-api-asset-patch-scope
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10182-api-asset-patch-scope

Conversation

@pablohashescobar

Copy link
Copy Markdown
Member

Description

GenericAssetEndpoint.patch in the public API set is_uploaded from the request body on any asset the caller's project access reached, without the can_modify_asset check the web API applies. A caller who could not modify an asset could still flip its upload state.

  • PATCH now requires can_modify_asset (the same helper the web API uses) and returns 403 otherwise.
  • It only ever marks the asset as uploaded, matching the web API's confirm-upload behaviour.

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

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • New 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.
  • Both files: 16 passed; the new tests fail without the fix.

References

  • WEB-10182

Created with Claude Code

…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.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:12
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9a561a79-b4b4-4679-ba34-080ccb5a5a06
Commits

Reviewing files that changed from the base of the PR and between 290383d and c13f462.

Files selected for processing: 3

  • apps/api/plane/api/views/asset.py
  • apps/api/plane/tests/contract/api/test_generic_asset_patch_scope.py
  • apps/api/plane/tests/contract/api/test_generic_asset_project_scope.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@makeplane

makeplane Bot commented Nov 15, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@pablohashescobar pablohashescobar changed the title [WEB-10182] fix(security): check modify rights on API asset PATCH [WEB-10182] fix: check modify rights on API asset PATCH Nov 16, 2026

@sriramveeraghanta sriramveeraghanta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Uses the same can_modify_asset as the web v2 views, and the other two PATCH handlers already filter by user_id.

@sriramveeraghanta
sriramveeraghanta merged commit ac796a1 into preview Nov 16, 2026
19 of 20 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10182-api-asset-patch-scope branch November 16, 2026 20:23
sriramveeraghanta pushed a commit that referenced this pull request Nov 16, 2026
The public API upload confirmation now requires the same permission as the
web app (can_modify_asset) and only marks the asset as uploaded.
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
)

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)
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.

3 participants