Multi-Tenancy Off Single Table

Options
I'm developing an application where I want to have multiple customers and each of those customers has multiple users. I'd like to make it so that when a user logs in, they only see data for their company from any tables, and no other company. Is this something I can achieve with Xano Authentication? Is there something specific I need to do with just filtering to achieve this?

Comments

  • Sam Bevis
    Sam Bevis Member
    Options
    I think this is the video you are looking for :)

    https://youtu.be/ohL2vR5wp3o
  • Patopt
    Patopt Member
    Options
     Thanks, I'm not sure I see anything in here specific to multi-tenant, just more on general auth. Is there something specific that needs to be done in terms of a precondition?
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    Multitenancy just means you are serving multiple customers from the same, shared resources - in this case a table. You would query the table for records to which your user/client has access. Xano makes all that pretty easy but not quite automatic. As a first step if this is not working quite right, check your database call to make sure the user filter is in your where clause. 
  • Patopt
    Patopt Member
    Options
     Thanks Ray. In this case I'm looking to have a multiple tenants (Companies) that each have multiple Users sharing the same resources. Is that supported?
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     Yes! The query is a little more complex that a direct user filter - basically you'd be looking for all the items in a given table that go with the company that goes with the user. But this is what other SaaS platforms with which you might be familiar do all the time.