squash this commit into #2969 - put back permission test that were erased