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: id(#cred{id = Id}) -> Id.
  perms(#cred{perms = Perms}) -> Perms.
  pass(#cred{pass = Pass}) -> Pass.
  
  id() ->
      bytes_to_iolist(crypto:rand_bytes(16)).
  
negative.code:             end
      end.
  
  %%====================================================================
  %% Internal functions
  %%====================================================================
  
  cred_from_dict(<<"pass">>, Pass, Cred = #cred{}) ->
      Cred#cred{pass = Pass};
  
  cred_from_dict(<<"name">>, Name, Cred = #cred{}) ->
      Cred#cred{name = Name};
  
  cred_from_dict(<<"full_api">>, _, Cred = #cred{perms = Perms}) ->
      Cred#cred{perms = ordsets:add_element(full_api, Perms)};
  