WSWhat Scene?

Learn · Security & privacy

What are database access rules?

Access rules are permissions enforced by the database itself rather than by your application code. Firestore and Cloud Storage call them security rules; Postgres calls it row-level security. They decide whether a given user may read or write a given record, and they run even when your app does not.

The reason to have them is that application checks only protect the paths you remembered to check. Rules sit underneath every path at once, including the one added next month by someone who did not read your middleware. They are the layer that holds when the layers above are bypassed.

Write them as denials first. Start from deny everything, then open the narrowest thing that works. A rule set that starts permissive and gets tightened is one forgotten path away from being open, and you will not find out from your logs.

Updated August 2026

Want this built, not just explained?