The query hits the database, but not every row is yours to see.
Fine-grained access control is the discipline of limiting exactly which data a user can read, update, or delete. Row-level security is the mechanism that enforces it. Together, they keep sensitive data safe without forcing you to split tables or redesign schemas.
Row-level security (RLS) works by applying filters at query runtime based on user identity, role, or other attributes. The database decides which rows are visible before sending results back. In PostgreSQL, RLS policies attach directly to tables and run automatically. In SQL Server, predicates and security functions handle the same job. This approach makes access rules declarative, consistent, and enforced in the core engine.
Fine-grained access control goes beyond roles. It means creating rules using actual business logic—customer ID matches session context, project membership aligns with request scope, or data classification dictates visibility. Without fine granularity, you end up over-permitting or building complex application-side checks that are harder to maintain.