fix(APP-965): Derive SPP proposal creation restriction from sub-plugin rules#1218
Merged
milosh86 merged 2 commits intoJul 15, 2026
Conversation
|
🚀 Preview Deployment: View Here |
|
E2E results (preview) Smoke
|
…n rules The process details page showed 'Unrestricted: anyone can create a proposal' for any wallet the creation simulation succeeded for. isRestricted now aggregates the sub-plugin creation rules; hasPermission keeps the simulation.
2e8a4a0 to
4dcf850
Compare
milosh86
approved these changes
Jul 14, 2026
|
|
||
| // The simulation only checks the connected wallet's permission; whether the process itself is restricted comes | ||
| // from the sub-plugin creation rules. | ||
| const isRestricted = pluginProposalCreationGuardResults.some( |
Contributor
There was a problem hiding this comment.
we probably could've used settings.length as a proxy for isRestricted too, but I think your version reads better 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes APP-965: the process details page showed "Unrestricted: anyone can create a proposal" for any connected wallet that was eligible to create one, even when the SPP process has real creation rules.
Root cause
APP-4547 (#766) moved the SPP proposal-creation guard to an RPC simulation (
useSimulateProposalCreation, auseCallfor the connected account) but left the guard'sisRestrictedderived from that wallet-scoped result:isRestrictedis a process-level fact ("are there restrictions on the action" — seeIPermissionCheckGuardResult; token derives it fromminProposerVotingPower > 0, multisig fromonlyListed), so an eligible wallet (simulation succeeds) flipped the whole process to "Unrestricted" inPermissionsDefinitionList. The negative path (ineligible wallet) rendered correctly, which is why this only showed for wallets that could create.Fix
useSppPermissionCheckProposalCreationnow aggregatesisRestrictedfrom the sub-plugin creation rules (restricted when any stage body restricts creation — the same source the displayedsettingsalready came from), whilehasPermissionkeeps using the RPC simulation for the wallet-level gate.Testing
useSppPermissionCheckProposalCreation.test.ts(5 cases): reproduces the bug against the pre-fix hook (restricted process + eligible wallet → was rendering unrestricted) and covers restricted/unrestricted aggregation,hasPermissionfrom the simulation, and loading composition.type-check,lint:check, and the jest suite pass; additionally verified red→green from a clean checkout in an isolated linux/arm64 sandbox (deny-by-default network, node 24) as part of the sealbox clean-room dogfood.@aragon/apppatch).Linear: APP-965