parameters: (request, namespace)
return_statement: return req_render_to_response(request, 'yourworld.html', {
          'settings': settings,
          'state': simplejson.dumps(state),
      })
docstring: Check permissions and route request.
docstring_summary: Check permissions and route request.
docstring_tokens: Check permissions and route request .
function: def yourworld(request, namespace):
      """Check permissions and route request."""
      world, _ = World.get_or_create(namespace)
      if not permissions.can_read(request.user, world):
          return HttpResponseRedirect('/accounts/private/')
      if 'fetch' in request.GET:
          return fetch_updates(request, world)
      can_write = permissions.can_write(request.user, world)
      if request.method == 'POST':
          if not can_write:
              return response_403()
          return send_edits(request, world)
      state = {
          'canWrite': can_write,
          'canAdmin': permissions.can_admin(request.user, world),
          'worldName': world.name,
          'features': permissions.get_available_features(request.user, world),
      }
      if 'MSIE' in request.META.get('HTTP_USER_AGENT', ''):
          state['announce'] = "Sorry, your World of Text doesn't work well with Internet Explorer."
      return req_render_to_response(request, 'yourworld.html', {
          'settings': settings,
          'state': simplejson.dumps(state),
      })
function_tokens: def yourworld ( request , namespace ) : world , _ = World . get_or_create ( namespace ) if not permissions . can_read ( request . user , world ) : return HttpResponseRedirect ( '/accounts/private/' ) if 'fetch' in request . GET : return fetch_updates ( request , world ) can_write = permissions . can_write ( request . user , world ) if request . method == 'POST' : if not can_write : return response_403 ( ) return send_edits ( request , world ) state = { 'canWrite' : can_write , 'canAdmin' : permissions . can_admin ( request . user , world ) , 'worldName' : world . name , 'features' : permissions . get_available_features ( request . user , world ) , } if 'MSIE' in request . META . get ( 'HTTP_USER_AGENT' , '' ) : state [ 'announce' ] = "Sorry, your World of Text doesn't work well with Internet Explorer." return req_render_to_response ( request , 'yourworld.html' , { 'settings' : settings , 'state' : simplejson . dumps ( state ) , } )