anchor.diff:              ?WARN("at=reportable_perms op=~p cred_id=~p perms=~p",
                     [Op, Id, ordsets:to_list(Perms)])
       end.
  +
  +upgrade_record(#cred{} = Cred) -> Cred;
  +upgrade_record({cred, Id, Pass, Perms}) ->
  +    #cred{id = Id, pass = Pass, perms = Perms, name = undefined}.
  
positive.code: -spec lookup(id()) -> #cred{} | 'no_such_cred'.
  lookup(Id) ->
      case ets:lookup(?CRED_TAB, Id) of
          [Cred = #cred{}] -> Cred;
          _ -> no_such_cred
      end.
  
  
negative.code:          ,auth/2
           ,has_perm/2
          ]).
  
  -export([upgrade_record/1]).
  
  -type id() :: binary().
  -type pass() :: binary().
  -type reportable_perm() :: 'any_channel' | 'full_api'.
  -type perm() :: reportable_perm() |
                  {'channel', logplex_channel:id()}.
  -type name() :: binary().
  
  -record(cred, {id :: id(),
                 pass :: pass(),
                 perms = ordsets:new() :: ordsets:ordset(perm()),
                 name :: name()
                }).
  
  -define(CRED_TAB, creds).
  