anchor.diff:  
   %% @doc determine if a member of the group, or recurse if necessary
   %%
  -parse_json_response(Name, Type, Body) ->
  +parse_json_response(Name, Type, OrgName, Body) ->
       try
           EJson = jiffy:decode(Body),
           Reqs = case Type of
  
positive.code:     end.
  
  %% @doc recurse over subgroups
  check_subgroups(_, _, []) ->
      false;
  check_subgroups(Name, Type, [Group|OtherGroups]) ->
      case group_membership(Name, Type, Group) of
          true ->
              true;
          _ ->
              check_subgroups(Name, Type, OtherGroups)
      end.
  
  %% @doc Check the code of the HTTP response and throw error if non-2XX
  
negative.code: -include_lib("eunit/include/eunit.hrl").
  
  -export([
            group_membership/4
          ]).
  
  %% @doc determine if a requestor is in a group, not in a group, or the group
  %% doesn't exist (returns undefined)
  -spec group_membership(Name :: string(), Type :: string(), OrgName :: string(),
                         Group :: string()) -> true | false | group_not_found.
  group_membership(Name, Type, OrgName, Group) ->
      {ok, Key} = chef_keyring:get_key(pivotal),
      Path = path(OrgName, Group),
      Headers =  chef_authn:sign_request(Key, <<"">>, "pivotal",
                                         <<"GET">>, now,
                                         list_to_binary(Path)),
      FullHeaders = [{"Accept", "application/json"}|Headers],
      group_membership(Name, Type, OrgName, Group, FullHeaders).
  
  group_membership(Name, Type, OrgName, Group, Headers) ->
      Url = url(OrgName, Group),
      case ibrowse:send_req(Url, Headers, get) of
          {ok, "404", _ResponseHeaders, _ResponseBody} ->
              group_not_found;
          {ok, Code, ResponseHeaders, ResponseBody} ->
              ok = check_http_response(Code, ResponseHeaders, ResponseBody),
              parse_json_response(Name, Type, OrgName, ResponseBody);
          {error, Reason} ->
              throw({error, Reason})
      end.
  
  url(OrgName, Group) ->
      {ok, ErchefHost} = application:get_env(pushy, erchef_root_url),
      ErchefHost ++ path(OrgName, Group).
  
  path(OrgName, Group) ->
      "/organizations/" ++ OrgName ++ "/groups/" ++ Group.
  
  %%
  %% Internal functions
  