The users collection kept PocketBase's defaults because the Plan 1a rules migration covered eight collections and missed this one: createRule "" -> anyone could sign up updateRule "id = @request.auth.id" -> anyone could edit their own record `role` is an ordinary field here, so both were escalations. Verified exploitable against the live instance: an anonymous request created an account with role "owner", and a client manager promoted themselves to owner by patching their own record. Either route yields read and write access to every client's board. Create, update and delete are now superuser-only; list and view are owner-or-self. Adds four integration tests so a regression fails loudly. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| 1789600100_created_clients.js | ||
| 1789600200_created_projects.js | ||
| 1789600300_extended_users.js | ||
| 1789600400_created_columns.js | ||
| 1789600500_created_cards.js | ||
| 1789600600_created_subtasks_comments.js | ||
| 1789600700_created_activity.js | ||
| 1789600800_created_settings.js | ||
| 1789600900_applied_api_rules.js | ||
| 1789601000_locked_user_rules.js | ||
| README.md | ||
These migrations never run
PocketBase applies files in pb_migrations/ when its own server starts.
This project does not start a PocketBase server — it uses one hosted instance
on Coolify, and the schema is applied to it over the admin API by
scripts/setup-remote.ts.
So every file in this directory is reference only. Editing one changes nothing, anywhere.
To change the schema, edit scripts/setup-remote.ts and run
npm run setup-remote.
These files are kept because they are the most readable statement of the
schema and its reasoning, and because they are what you would mount into the
container if this project ever moves to PocketBase's native migration flow. If
you update setup-remote.ts, update these too — but understand that doing so
is documentation, not deployment.