PostgreSQL - automating database grants
You can define event triggers on many DDL events, but there is no event trigger for CREATE DATABASE.  This means you will have to include the access rights in the database definition.  From this point, there are two ways: one is again event triggers, the other is setting default privileges for the different object types you have.  I prefer the latter in any case, for being much cleaner (objects and privileges are defined the same way, that is easy to grasp for developers and other humans, too).

For an example how it could work, see one of my older answers, and there the ALTER DEFAULT PRIVILEGES bits.  It's about tables, but you can easily generalize it to other object types.