added authorization function with ability to view own posts