BUG: Missing RLS policies occur DB access error(P42501)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia da schema.sql e dal comportamento di Supabase RLS distribuendo lo schema e riproducendo l’insert di onboarding del paziente. Esamina i pattern di accesso delle 14 tabelle elencate e la dipendenza da PR #156, quindi verifica che le operazioni autenticate di pazienti e terapisti non restituiscano più 42501, inclusa la policy aggiuntiva per therapist_type dopo il merge di PR #156.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- I have searched the existing issues
What happened?
This issue and related PR were fully identified and analyzed by myself. Claude was only used to assist with writing descriptions in English.
📌 Issue Overview
schema.sql defines all tables but has no Row Level Security (RLS) policies. When RLS is enabled on Supabase (default behavior), all authenticated operations are blocked with 42501 errors because no policies exist to grant access.
🔍 Steps to Reproduce
- Deploy the schema to a Supabase project
- Sign up and log in as a patient
- Complete the onboarding flow (insert into
patienttable)
🎯 Expected Behavior
Authenticated users should be able to perform CRUD operations on their own records according to their role (patient or therapist).
🚨 Actual Behavior
All DB operations fail with:
PostgrestException(message: new row violates row-level security policy for table "patient", code: 42501)
💡 Suggested Improvements
Add RLS policies for all 14 tables in schema.sql with the following access patterns:
| Table | Policy |
|---|---|
therapist |
Own record INSERT/SELECT/UPDATE via auth.uid() |
patient |
Own record INSERT/SELECT/UPDATE + therapist can SELECT their patients |
package |
Read-only for all authenticated users |
session |
Therapist full CRUD on own sessions, patient SELECT/INSERT/UPDATE on own sessions |
therapy |
Read-only for all authenticated users |
therapy_goal |
Therapist full CRUD, patient SELECT on own goals |
assessments |
Read-only for all authenticated users |
assessment_results |
Patient INSERT/SELECT own results, therapist SELECT their patients' results |
goal_master, observation_master, regression_master, activity_master |
Read-only for all authenticated users |
daily_activities |
Therapist full CRUD, patient SELECT own activities |
daily_activity_logs |
Patient full CRUD on own logs, therapist SELECT their patients' logs |
Improvement PR is ready and waiting for PR #156 been merged.
When PR #156 is merged, additional policy for table
therapist_typewould be needed.
Record
- I agree to follow this project's Code of Conduct
- I want to work on this issue
- Lingua principale
- Dart
- Stelle
- 30
- Fork
- 49
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di AOSSIE-Org/NeuroTrack
-
fix(therapist): Method marked @override does not override any inherited methodForse già presa @Muneerali199 l’ha presa 252 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#198 ·
-
fix: Don't use BuildContext across async gaps (use_build_context_synchronously)Forse già presa @Muneerali199 l’ha presa 252 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#197 ·
-
fix(patient): Remove unused and duplicate imports across patient appForse già presa @Muneerali199 l’ha presa 252 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AOSSIE-Org/NeuroTrack#195 ·
-
BUG: Therapy details save button has no loading guard, allowing duplicate submissions that inflate patient regression reportsForse già presa @Varadraj75 l’ha presa 215 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
AOSSIE-Org/NeuroTrack#221 ·
-
BUG: Appointment booking ignores selected time slot, every appointment saved at midnight to SupabaseForse già presa @Varadraj75 l’ha presa 220 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
AOSSIE-Org/NeuroTrack#219 ·
Tutte le issue di AOSSIE-Org/NeuroTrack
Issue simili
-
Drop the decision-issue rule from ARCHITECTURE.mdForse già presa @abianche l’ha presa oggi. Apertachore
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 61/100
I maintainer di solito rispondono entro 1 giorno
-
duration: tiny priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
duobaseio/forui#1249 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Off-by-one error in CharacterRange.length excludes end characters ('z', 'Z', '9', 'ÿ')Forse già presa @TimelordLeo l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
I maintainer di solito rispondono entro 2 giorni
-
[Bug] Missing Simplified Chinese translation for 'balance' and 'lowest' balancer outbound namesApertabug from-telegram platform:android version:v5.9.15
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
hiddify/hiddify-app#2655 ·
I maintainer di solito rispondono entro 1 giorno