Repository navigation
fix(action-center): keep members from changing a Getting started step back to opened - #1255
Merged
gkhngyk merged 1 commit intoOct 20, 2026
Conversation
… back to opened 00196's update policy on getting_started_steps checked the new row (only an admin or a manager may write skipped or done) but not the row being changed, so through PostgREST any member could turn a skipped or done step back into opened. The app never does: the page RPC inserts with on conflict do nothing, and skipping a step or saving the KPIs is an admin's or a manager's. 00202 adds the same check to the policy's using: the row must be opened, or the user an admin or a manager. Follow-up to gkhngyk's note on ansvisor#1234. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
gkhngyk
approved these changes
Oct 20, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good. using now matches with check, so a member can't turn a skipped or done step back into opened. 00202 is applied to production.
7 of 12 tasks
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
Follow-up to gkhngyk's optional note on #1234: "the update policy's
usingstill lets any member turn askippedordonerow back intoopenedthrough PostgREST."00196's update policy on
getting_started_stepschecked the new row inwith check: any member may writeopened, but only an admin or a manager may writeskippedordone. It didn't check the row being changed (using), so an analyst could update adonerow toopened.Migration 00202 recreates the policy with the same condition in
using: the row must beopened, or the user an admin or a manager.with checkis 00196's.Why the app is unaffected
getting_started_page_opened) inserts withon conflict do nothing.skipGettingStartedStepand the KPI save'sdoneare admin and manager writes.Related issue
Follow-up to #1234.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
On the dev DB, in rolled-back transactions as
authenticatedwith the demo user's JWT, I set thekpisstep todoneand switched the user's role within the transaction:update … set state = 'opened' where state = 'done'bash supabase/build-schema.shrebuiltschema.sql. 00202 is applied on the dev DB.Numbering: main has up to 00199. Open PRs: 00197 #1243, 00200 #1247, 00201 #1253.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/) — web not touchedyarn typecheckpasses (run fromweb/) — web not touchedyarn format:checkpasses (run fromweb/) — web not touched🤖 Generated with Claude Code