comparing permissions on the input hierarchy given