permissions

implemented permissions. fixed bug in view post if there were no
unviewed posts.