Refectoring controlers

Refectoring comments_controller.rb and posts_controller.rb
permissions fix up

fix up file permissions.