def check_can_access(node, user, key=None, api_node=None):
 if (user is None):
  return False
 if ((not node.can_view(Auth(user=user))) and (api_node != node)):
  if (key in node.private_link_keys_deleted):
   status.push_status_message('The view-only links you used are expired.', trust=False)
  raise HTTPError(http.FORBIDDEN, data={'message_long': 'User has restricted access to this page. If this should not have occurred and the issue persists, please report it to <a href="mailto:support@osf.io">support@osf.io</a>.'})
 return True

def check_can_access ( node , user , key = None , api_node = None ) : if ( user is None ) : return False if ( ( not node . can_view ( Auth ( user = user ) ) ) and ( api_node != node ) ) : if ( key in node . private_link_keys_deleted ) : status . push_status_message ( 'The view-only links you used are expired.' , trust = False ) raise HTTPError ( http . FORBIDDEN , data = { 'message_long' : 'User has restricted access to this page. If this should not have occurred and the issue persists, please report it to <a href="mailto:support@osf.io">support@osf.io</a>.' } ) return True
view helper that returns whether a given user can access a node .