So are you just providing an API and the database will be stored on your server? Or will users install it on their own hardware?
Building a sports site and only friends of team members or the team members themselves can message each other? Build it in your authorization model. The UI will only see appropriate recipients and only be able to send messages to them. In other words, a lot of your architecture could become UI-DB direct and only a portion going through a business layer.