anchor.diff:           ,pass/0
            ,pass/1
            ,perms/1
  +         ,name/1
  +         ,rename/2
            ,id_to_binary/1
            ,binary_to_id/1
            ,grant/2
  
positive.code:             end
      end.
  
  
  
  %%====================================================================
  %% Internal functions
  %%====================================================================
  
  cred_from_dict(<<"pass">>, Pass, Cred = #cred{}) ->
      Cred#cred{pass = Pass};
  
  cred_from_dict(<<"full_api">>, _, Cred = #cred{perms = Perms}) ->
      Cred#cred{perms = ordsets:add_element(full_api, Perms)};
  
negative.code: -spec lookup(id()) -> #cred{} | 'no_such_cred'.
  lookup(Id) ->
      case ets:lookup(?CRED_TAB, Id) of
          [Cred = #cred{}] ->
              %% Check to see whether we need to upgrade a cred.
              case upgrade_record(Cred) of
                  Cred -> Cred;
                  NewCred ->
                      cache(NewCred),
                      NewCred
              end;
          _ -> no_such_cred
      end.
  
  