
Answer-first summary for fast verification
Answer: Implement row-level security by creating a custom function that filters the data based on the tenant_id and the user's role.
Option C is the correct answer. Implementing row-level security by creating a custom function that filters the data based on the tenant_id and the user's role allows you to enforce data access control for multi-tenant applications. This approach ensures that each tenant can only access their own data based on the user's role. Option A is incorrect because creating a separate database for each tenant is not scalable and does not provide row-level security. Option B is incorrect because stored procedures alone do not provide a consistent security model. Option D is incorrect because Azure Cosmos DB does not have built-in support for role-based access control (RBAC).
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are designing a data access control system for a multi-tenant application using Azure Cosmos DB. Which of the following approaches should you use to implement row-level security?
A
Create a separate database for each tenant and implement role-based access control (RBAC) at the database level.
B
Create a single database with a tenant_id column in each table and implement row-level security using stored procedures.
C
Implement row-level security by creating a custom function that filters the data based on the tenant_id and the user's role.
D
Use Azure Cosmos DB's built-in support for role-based access control (RBAC) to assign permissions to specific roles for each tenant.
No comments yet.