Wrote custom security rules and publish/subscribe.