Added logout functionality. Permission check on pages.