anchor.diff:          Body -> Body
       end.
   
  +is_authorized_message(not_member_of_org, User, Org) ->
  +    Msg = iolist_to_binary([<<"'">>, User, <<"' not authorized to search '">>,
  +                            Org, <<"'.">>]),
  +    {[{<<"error">>, [Msg]}]};
  +is_authorized_message(org_not_found, _User, Org) ->
  +    Msg = iolist_to_binary([<<"organization '">>, Org,
  +                            <<"' does not exist.">>]),
  +    {[{<<"error">>, [Msg]}]}.
  +
  +
  +verify_request_message({not_found, client}, User, _Org) ->
  +    Msg = iolist_to_binary([<<"Failed to authenticate as '">>, User, <<"'. ">>,
  +                            <<"Ensure that your node_name and client key ">>,
  +                            <<"are correct.">>]),
  +    {[{<<"error">>, [Msg]}]};
  +verify_request_message({not_found, org}, _User, Org) ->
  +    Msg = iolist_to_binary([<<"organization '">>, Org,
  +                            <<"' does not exist.">>]),
  +    {[{<<"error">>, [Msg]}]}.
  +
  +
   error_json(bad_sig) ->
       {[{<<"error">>, [<<"bad signature">>]}]};
   error_json(no_cert) ->
  +%% {\"error\":[\"Failed to authenticate as seth-xxx-yyy. Ensure that your node_name and client key are correct.\"]}"}
       {[{<<"error">>, [<<"user, client, or organization not found">>]}]};
   error_json({missing_headers, Missing}) ->
       {[{<<"error">>,
  
positive.code: 	    case chef_otto:is_user_in_org(S, UserName, OrgName) of
  		true -> {true, Req1, State1};
  		false ->
  		    Msg = error_json(not_member_of_org),
  		    Json = ejson:encode(Msg),
                      Req2 = wrq:set_resp_body(Json, Req),
  		    {false, Req2, State1}
  	    end;
  	Other -> Other
      end.
  
  resource_exists(Req, State = #state{solr_query = QueryWithoutGuid}) ->
      try
          OrgGuid = fetch_org_guid(Req, State),
          Query = chef_solr:add_org_guid_to_query(QueryWithoutGuid, OrgGuid),
          {true, Req, State#state{organization_guid = OrgGuid, solr_query = Query}}
      catch
  
negative.code: 
  verify_request_signature(Req, State = #state{organization_name = OrgName}) ->
      UserName = wrq:get_req_header("x-ops-userid", Req),
      S = chef_otto:connect(),
      case chef_otto:fetch_user_or_client_cert(S, OrgName, UserName) of
          {not_found, What} ->
              NotFoundMsg = verify_request_message({not_found, What},
                                                   UserName, OrgName),
              {false, wrq:set_resp_body(ejson:encode(NotFoundMsg), Req), State};
          CertInfo ->
              %% TODO this causes us to fetch the organization a second
              %% time.  Keep it and pass it in instead.
              Cert = ?gv(cert, CertInfo),
              Body = body_or_default(Req, <<>>),
              HTTPMethod = iolist_to_binary(atom_to_list(wrq:method(Req))),
  