Refactor to create check_parent_access() which can be called for file creation too.