codesydney / marketplace-app-for-good

1 stars 1 forks source link

MA9 - Handle Customer and Service Providers roles #38

Open davidtaing opened 5 months ago

davidtaing commented 5 months ago

Adding customer or service provider roles will make it easier for us to implement RBAC using Supabase RLS. At the moment we don't distinguish between Customer users and Service Provider users, so a Provider could create a task.

There's a few ways we can approach this:

  1. add new postgres roles for Customers and Service Providers
  2. add custom claims to the user's JWT
  3. perform joins in our postgres policies

3 is probably a bad idea since these are probably high frequency queries.

Let's look into 1 and 2.