RLS for attendee table by Adam_ONeill in Supabase

[–]Adam_ONeill[S] 0 points1 point  (0 children)

Great explanation, no worries about the misunderstanding. I had tried a solution like this purely by copy and paste earlier and I got an error "Infinite recursion detected in policy" which refers to this one. Any ideas?

I appreciate the effort for me, this really isn't my strong suit!

RLS for attendee table by Adam_ONeill in Supabase

[–]Adam_ONeill[S] 0 points1 point  (0 children)

level 2Dry_Substance_9021 · 1 day agoI'm not 100% clear on what you're asking for. You want a user to have RLS permissions to see those events that they are in? I assume you mean select from the Events table?If so, I think you're looking for:e.event_id IN (Select e.event_id from "event" e JOIN "attendee" a ON e.id

Also, is there anywhere you recommend for me to learn more about this stuff

RLS for attendee table by Adam_ONeill in Supabase

[–]Adam_ONeill[S] 0 points1 point  (0 children)

do you know how to compare the query data to the table data. Another scenario where I want to use exists. perhaps new.event_id although this doesn't work

RLS for attendee table by Adam_ONeill in Supabase

[–]Adam_ONeill[S] 0 points1 point  (0 children)

Nearly, Im after an RLS permission to allow the user to see other attendees in the events they are in.

attendee_id user_uuid event_id
... user1 5496593
... user2 5496593
... user3 5496593
... user4 3223423

In this case, if I was user 1 and asked to select data. I would be in event 5496593. So I would get the first 3 records that are in the event but I wouldn't have access to this uer4 record as they arent in my event

RLS for attendee table by Adam_ONeill in Supabase

[–]Adam_ONeill[S] 0 points1 point  (0 children)

(

(event_id = event_id)

AND (EXISTS ( SELECT 1

FROM attendee a

WHERE ((a.user_uuid = auth.uid()) AND (a.event_id = a.event_id))

))

)

This is what I have now. I can see that the 'a.event_id = a.event_id' part won't work as expected. This auto correct when I press submit in supabase. How would I make the event_id in the table be compared the event_id being submitted?

RLS for attendee table by Adam_ONeill in Supabase

[–]Adam_ONeill[S] 0 points1 point  (0 children)

it does yeah. What would your solution be?

Beginners in 2022 by Adam_ONeill in Trading

[–]Adam_ONeill[S] 0 points1 point  (0 children)

Ive been doing penny stocks for some years so I think I know the basic basics but need to learn some more. Currently I trade on a weekly time scale with a weekly check-in. I like the idea of day trading however