Fix bug with permissions matching