anchor.diff:  
   accumulate_grants(Role, Type) ->
       %% The 'all' grants always apply
  -    All = riak_core_metadata:fold(fun({{_R, _Bucket}, [?TOMBSTONE]}, A) ->
  -                                          A;
  -                                     ({{_R, Bucket}, [Permissions]}, A) ->
  -                                          [{{<<"group/all">>, Bucket},
  -                                            Permissions}|A]
  -                                  end, [], metadata_grant_prefix(group),
  -                                  [{match, {all, '_'}}]),
  +    All = lists:map(fun ({{_Role, Bucket}, Permissions}) ->
  +                            {{<<"group/all">>, Bucket}, Permissions}
  +                    end, match_grants({all, '_'}, group)),
       {Grants, _Seen} = accumulate_grants([Role], [], All, Type),
       lists:flatten(Grants).
   
  
positive.code: %% INTERNAL
  %% ============
  
  metadata_grant_prefix(user) ->
      {<<"security">>, <<"usergrants">>};
  metadata_grant_prefix(group) ->
  
negative.code:                         not lists:member(G,Seen),
                          group_exists(G)],
      {NewAcc, NewSeen} = accumulate_grants(Groups, [Role|Seen], Acc, group),
      Grants = lists:map(fun ({{_Role, Bucket}, Permissions}) ->
                                 {{concat_role(Type, Role), Bucket}, Permissions}
                         end, match_grants({Role, '_'}, Type)),
      accumulate_grants(Roles, NewSeen, [Grants|NewAcc], Type).
  
  %% lookup a key in a list of key/value tuples. Like proplists:get_value but
  