checking if logged in user is allowed to edit