Spear.Acl.to_map

You're seeing just the function to_map, go back to Spear.Acl module for more information.
Link to this function

to_map(acl)

View Source (since 0.1.3)

Specs

to_map(t()) :: %{required(String.t()) => String.t() | [String.t()]}

Converts an ACL struct to a map with the keys expected by the EventStoreDB

This function is used internall by Spear.set_global_acl/4 to create a global ACL event body, but may be used to create an acl body on its own.

Examples

iex> Spear.Acl.allow_all() |> Spear.Acl.to_map()
%{
  "$w" => "$all",
  "$r" => "$all",
  "$d" => "$all",
  "$mw" => "$all",
  "$mr" => "$all"
}