Repository navigation
[WEB-10186] fix: check permission before cache invalidation - #10315
Conversation
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.
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.
|
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 19 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. |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
Description
On several views
@invalidate_cachesat 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,destroyStateViewSet:create,mark_as_default,destroyWorkSpaceMemberViewSet.leaveNo change for callers who pass the permission check.
Not changed:
WorkspaceJoinEndpoint.postinvalidates before it validates the invitation, but it has noallow_permissionto reorder.Type of Change
Screenshots and Media (if applicable)
Test Scenarios
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
Created with Claude Code