Skip to content

[WEB-10186] fix: check permission before cache invalidation - #10315

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10186-label-permission-order
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10186-label-permission-order

Conversation

@pablohashescobar

Copy link
Copy Markdown
Member

Description

On several views @invalidate_cache sat above @allow_permission, so the cache invalidation (for labels, a key scan built from the URL slug) ran before the permission check, including for callers the check then rejected.

Decorator order only, so permission is checked first:

  • LabelViewSet: create, partial_update, destroy
  • StateViewSet: create, mark_as_default, destroy
  • WorkSpaceMemberViewSet.leave

No change for callers who pass the permission check.

Not changed: WorkspaceJoinEndpoint.post invalidates before it validates the invitation, but it has no allow_permission to reorder.

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/app/test_cache_invalidation_permission_order_app.py: a denied label, state or leave request does not call the invalidation helper; an allowed label create still invalidates once. 4 passed; the denied cases fail without the fix.

References

  • WEB-10186

Created with Claude Code

Label, state and workspace-leave writes ran their cache invalidation before
the role check. The permission decorator now sits outermost, so a denied
request no longer touches the cache.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:13

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.

@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 19 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: 99d15b61-3476-4aac-8665-aee21e5c3b00
Commits

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

Files selected for processing: 4

  • apps/api/plane/app/views/issue/label.py
  • apps/api/plane/app/views/state/base.py
  • apps/api/plane/app/views/workspace/member.py
  • apps/api/plane/tests/contract/app/test_cache_invalidation_permission_order_app.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

@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-10186] fix(security): check permission before cache invalidation [WEB-10186] fix: check permission before cache invalidation Nov 16, 2026
@sriramveeraghanta
sriramveeraghanta merged commit 258e03c into preview Nov 16, 2026
19 of 21 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10186-label-permission-order branch November 16, 2026 09:37
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
…e#10315)

Label, state and workspace-leave writes ran their cache invalidation before
the role check. The permission decorator now sits outermost, so a denied
request no longer touches the cache.

(cherry picked from commit 258e03c)
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