Revert "improved memory efficiency by checking bag permissions early"

@cdent notes that after the refactoring, we were checking the same bag
multiple times

This reverts commit 5ce56f17d1d870954453c99d15e794b2e80ad537.