mod_auth_pgsql can be used to limit access to documents served by a web server by checking fields in a table in a PostgresQL database.