Different profiles collections

Hi, I’m building a client portal, where there will be 3 fdifferent types of users.

I would like to know if there is a good practice to have about collections : do you create one collection that you filter regarding the profile of the user ? Or rather 3 different collection of the same db, to avoid clunky filtering ?

Thanks

I have 3 user types also. I pull them all into the same collection and do filtering on the collection. I am using supabase so thats a backend filter. it might be different to do backend filtering with other databases, Im not sure.

If you need to restrict access to pages based on user type you can use the roles section. top menu bar “auth” then “roles” on the left. But you have to pay the “scale” membership which is $149 per month. So what I did was i just created workflows and restricted access that way. Its a bit of a hassle, but the workflows redirect anyone thats not the correct user type. I think weweb should just put the roles option into the starter membership but thats not up to me.

I hope that answeres your question

Thanks for your reply.

Okay I see, I’m also using Supabase as a backend, but for the moment, still on the free plan. And I’m also filtering the collection directly, even if a bit tricky sometimes with 3 profiles, good to know I’m not alone !

What bothers me i that when I sign in, some datas aren’t loaded, like financial reports are all to “0”, but when I refresh, the good figures come back.
I set up a page workflow to load every collections when signin in, but still the case. Did you encounter some problems like this ?

Make sure your collection is set to “fetch collection automatically” but I have found that doesnt always work so in that case i set a page workflow that fetches the collection on page load. that fixed my issue

1 Like

Exactly, that’s what I’m doing. Glad to see I’m not alone with it ! Thanks for your reply