added canManagePost method that checks if a user is logged in and if that user is an admin or the author of a post; used to assess admin rights or user rights