Help with Supabase RLS policies

But it is the same just public key

OMG is thought it is the same but it is the service role…
Thank you so much!

I will correct the summary above.

But this is right yes, we have to set the select for everyone in RSL for the weweb plugin to work?

1 Like

Just for the auth. If you want it to work with auth users. If you want to make it public, then you need to set select for all

Hmm I think I have to learn a bit more to understand your answer.
Just for auth means what? That just some tables for the auth needs to have this “everyone select” policy but not the other tables?

I think there a some other people out there who want a system where only auth users can select data.
Maybe someone can explain this topic of the authorisation a little more…

Dont forget to regenerate your service key now that you shared it in public

ahhh you are right… I will also delete the post…
hmm in the plugin I can’t even change the service key just the public key.
I think I have read you are using both keys in the supabase plugin…

i’m sorry the plugin behavior is confusing, its understandable

Currently, when you use INSERT/DELETE/UPDATE/UPSERT action, it returns the concerned elements by default. Its how supabase sdk works. But its an issue because to be able to return you have to allow select.

The workaround is to set a specific settings saying I dont want to return, but we are not exposing this option yet. So, the workaround in WeWeb is to do the action by yourself using wwLib.wwPlugins.supabase.instance.insert(data, {returning: 'minimal'})

(returning minimal is the famous parameter so it doesnt return the whole data and it doesnt require you to allow select)

In the coming weeks we plan to release a new version of supabase where we will update to the new sdk version. It will solve the issue as the action will not return data by default anymore, and we will let you configure if you want to.

But if you used the js snippet you will have to update it to
wwLib.wwPlugins.supabase.instance.insert(data).select()
or remove it to use the new updated action instead.

Hope its a little bit clearer

Ahhhh thank you Alexis!
Now I understand it. I will help other people too…

A very nice support in this community. I love weweb and the possibilities it offers in the frontent and hope it will become the new gold standard…
Have I already mentioned. Weweb is extremely fast compared to retool and others…

1 Like