fix(access-control): exempt legacy blocks#5063
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Runtime and client enforcement no longer special-case only Tests mock Reviewed by Cursor Bugbot for commit d7bb037. Configure here. |
Greptile SummaryThis PR fixes a regression where legacy blocks (deprecated integrations with
Confidence Score: 5/5Safe to merge — the change consolidates an existing exemption pattern into a shared helper and extends it to legacy blocks, with no new security surface. All four enforcement call sites are updated consistently. The new No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Block type to check] --> B{isBlockTypeAccessControlExempt?}
B -->|start_trigger| C[✅ Exempt — return allowed]
B -->|hideFromToolbar === true| C
B -->|No| D{Permission config loaded?}
D -->|No config / allowedIntegrations null| E[✅ Unrestricted — return allowed]
D -->|Config with allowedIntegrations| F{blockType in allowedIntegrations?}
F -->|Yes| G[✅ Allowed]
F -->|No| H[❌ IntegrationNotAllowedError]
subgraph Call sites
S1["validateBlockType (server)"]
S2["assertPermissionsAllowed (server)"]
S3["isBlockAllowed / filterBlocks (client hook)"]
S4["isBlockTypeAllowed (copilot validation)"]
end
S1 & S2 & S3 & S4 --> A
Reviews (1): Last reviewed commit: "fix(access-control): exempt legacy block..." | Re-trigger Greptile |
Summary
Exempt legacy blocks from access controls
Type of Change
Testing
Tested manually
Checklist