A multi-tenant environment typically uses two mechanism to restrict the records a user can see:

  • Each tenant has their own database and Stonefield Query automatically connects to the correct database when a user logs in.

  • All tenants share a database, but each table has a certain field containing an ID indicating which tenant the record belongs to.

If you use the latter mechanism, enter the name of the field in the Filter field for queries in multi-tenant setting (the assumption is that all tables use the same named field) and specify the data type for that field in the Data type of tenant filter field setting. Stonefield Query automatically adds a condition of "field = value" to the WHERE clause of every SQL statement it sends to the database, where field is the name of the field you specify in this setting and value is the ID for the tenant the current user belongs to as set in the Tenants tab of the Security dialog in Stonefield Query.

See Also

Configuration Settings | Data Type of Tenant Filter Field