refactor the code so BZ auth checking works both for package edit page and inline editor