anchor.diff:  -include_lib("eunit/include/eunit.hrl").
   
   -export([
  -          group_membership/3
  +          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(),
  -                             Group :: string()) -> true | false | group_not_found.
  -group_membership(Name, Type, Group) ->
  +-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(Group),
  +    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, Group, FullHeaders).
  +    group_membership(Name, Type, OrgName, Group, FullHeaders).
   
  -group_membership(Name, Type, Group, Headers) ->
  -    Url = url(Group),
  +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, ResponseBody);
  +            parse_json_response(Name, Type, OrgName, ResponseBody);
           {error, Reason} ->
               throw({error, Reason})
       end.
   
  -url(Group) ->
  +url(OrgName, Group) ->
       {ok, ErchefHost} = application:get_env(pushy, erchef_root_url),
  -    ErchefHost ++ path(Group).
  +    ErchefHost ++ path(OrgName, Group).
   
  -path(Group) ->
  -    "/groups/" ++ Group.
  +path(OrgName, Group) ->
  +    "/organizations/" ++ OrgName ++ "/groups/" ++ Group.
   
   %%
   %% Internal functions
  
positive.code: 
  %% @doc determine if a member of the group, or recurse if necessary
  %%
  parse_json_response(Name, Type, Body) ->
      try
          EJson = jiffy:decode(Body),
          Reqs = case Type of
  
negative.code:     end.
  
  %% @doc recurse over subgroups
  check_subgroups(_, _, _, []) ->
      false;
  check_subgroups(Name, Type, OrgName, [Group|OtherGroups]) ->
      case group_membership(Name, Type, OrgName, Group) of
          true ->
              true;
          _ ->
              check_subgroups(Name, Type, OrgName, OtherGroups)
      end.
  
  %% @doc Check the code of the HTTP response and throw error if non-2XX
  