added admin functionality to layout, added before filter to posts controller