Huntedman
01/05/2023, 7:41 PMsql
CREATE VIEW public.public_trainings AS
SELECT
id,
published_at,
required_read_permission
FROM public.trainings;
I was surprised that anon, and authenticated could do INSERT 😱😱😱 operations on the base table through this view.
so I ended up doing
sql
REVOKE ALL ON public.public_trainings FROM anon, authenticated;
GRANT SELECT ON public.public_trainings TO anon, authenticated;
Is this enough to only allow select operations on the view? Are there any other roles jwt users could assume?garyaustin
01/05/2023, 7:44 PMHuntedman
01/05/2023, 7:47 PMHosenur
01/05/2023, 9:28 PMgaryaustin
01/05/2023, 9:52 PMzetashift
01/05/2023, 11:19 PMhelp
, because it seems a significant amount of people ask their questions heregaryaustin
01/05/2023, 11:32 PMzetashift
01/05/2023, 11:44 PMcoker
01/06/2023, 3:18 AMzetashift
01/06/2023, 3:29 AMcoker
01/06/2023, 3:29 AMzetashift
01/06/2023, 3:30 AMthemes.dev
01/06/2023, 7:22 AMDesmond
01/06/2023, 9:45 AMclient.from('table').select('*').eq('created_at::date','YYYY-MM-DD');
where YYYY-MM-DD is a string. This, however, doesn't work. (Flutter/Dart)Desmond
01/06/2023, 9:47 AMclient.from('table').select('*').eq('created_at::year','YYYY').eq('created_at::month','MM').eq('created_at::day','DD');
yields no result..Desmond
01/06/2023, 10:27 AMclient.from('table').select('*').gte('created_at','today()');
gives the wanted result.Lewey
01/06/2023, 3:13 PMskiabox
01/06/2023, 3:42 PMskiabox
01/06/2023, 3:42 PMskiabox
01/06/2023, 3:43 PMskiabox
01/06/2023, 3:43 PMRainZone
01/06/2023, 10:36 PMcannap
01/07/2023, 2:33 PMthy
01/07/2023, 3:27 PMGregory
01/07/2023, 5:22 PMsilentworks
01/07/2023, 9:43 PMhonkstyle
01/08/2023, 3:08 AMnahtnam
01/08/2023, 6:53 AM!hint
and !inner
? I can't find docs for it anywhereVik
01/08/2023, 7:06 AM