def METHOD_NAME(path: str) -> Response:
	"""Checks permissions and sends back private file"""
	files = frappe.get_all("File", filters={"file_url": path}, fields="*")
	# this file might be attached to multiple documents
	# if the file is accessible from any one of those documents
	# then it should be downloadable
	for file_data in files:
		file: "File" = frappe.get_doc(doctype="File", **file_data)
		if file.is_downloadable():
			break
	else:
		raise Forbidden(_("You don't have permission to access this file"))
	make_access_log(doctype="File", document=file.name, file_type=os.path.splitext(path)[-1][1:])
	return send_private_file(path.split("/private", 1)[1])