Sequelize plugin to enforce the protection of tenant data in a multi-tenanted database. It will prevent querying, updating and deleting data if a tenantId
is not specified in the query.
- Make
tenantId
configurable - Check to ensure a single
tenantId
has been provided
const Sequelize = require('sequelize');
const sequelizeTenantProtection = require('sequelize-tenant-protection');
const sequelize = new Sequelize(...);
sequelizeTenantProtection(sequelize);