Implement function to check whether the tree has a permission