anchor.diff:  -define(SCOPE_SEPARATOR, <<"::">>).
   -define(SCOPED_NAME_REGEX, "^(?:(" ?NAME "+)|(?:(" ?NAME "*)\\:\\:(" ?NAME "+)))$").
   
  --type db_callback() :: fun().
  +-type db_callback() :: fun((any()) -> any()).
   
   -record(context, {org_id :: binary(),
                     db_context :: any() | undefined,
  
positive.code:     {AuthzIds, Remaining, ordsets:new()}.
  
  %% Helper functions for oc_chef_authz_db:authz_records_by_name and oc_chef_authz_db:find_org_actors_by_name
  names_from_records(Records) ->
      [ name_from_record(R) || R  <- Records].
  
  name_from_record({Name, _,  _}) ->
      Name;
  name_from_record({Name, _}) ->
      Name.
  
  ids_from_records(Records) ->
      [ id_from_record(R) || R <- Records ].
  
  id_from_record({_, AuthzId}) ->
      AuthzId;
  id_from_record({_, UserAuthzId, null}) ->
  
negative.code: %% Context is used to thread external state information through the system
  %%
  %% Dialyzer is grouchy unless undefined is included in types.
  -spec initialize_context(binary()) -> #context{}.
  initialize_context(OrgId) ->
      initialize_context(OrgId, make_sql_callback()).
  
  -spec initialize_context(binary(), db_callback()) -> #context{}.
  initialize_context(OrgId, CallBackFun) ->
      initialize_context(OrgId, undefined, CallBackFun).
  
  -spec initialize_context(binary(), tuple() | undefined, db_callback()) -> #context{}.
  initialize_context(OrgId, DbContext, CallBackFun) ->
      #context{org_id = OrgId,
               db_context = DbContext,
  