def download_private_file(path):
 try:
  check_file_permission(path)
 except frappe.PermissionError:
  raise Forbidden(_(u"You don't have permission to access this file"))
 return send_private_file(path.split(u'/private', 1)[1])

def download_private_file ( path ) : try : check_file_permission ( path ) except frappe . PermissionError : raise Forbidden ( _ ( u"You don't have permission to access this file" ) ) return send_private_file ( path . split ( u'/private' , 1 ) [ 1 ] )
checks permissions and sends back private file .