HDFS-5923: refactor permission assertions