HomeCase StudiesLayered Visibility Controls for Audience, Age and Blocking
Data SecuritySecurity, Identity & Privacy

Layered Visibility Controls for Audience, Age and Blocking

Once the platform carried business listings, anonymous posts and age-sensitive content, "who can see this" stopped being a single on/off flag.

The Challenge

A post might be public, network-only, locality-restricted, age-gated, hidden by an individual reader, or invisible due to a mutual block — and these rules stack. Enforcing them in the app was never an option: any rule the client applies is a rule that can be stripped out, exposing restricted content to exactly the people it was withheld from.

Solution & Architecture

Built visibility as a chain of independent server-side layers, each narrowing the result before data ever leaves the database. Audience scope is resolved first (public, own posts, or network posts validated against a real following relationship), then age restrictions computed from the stored birth date rather than anything the client sends, then personally hidden posts, then mutual blocks checked in both directions. The identical chain runs on every access path — feed, map, search, category tabs and profiles — so there's no unprotected route to the data.

Technologies & Tools Used:

SupabasePostgreSQL FunctionsRow-Level Security