# `Rivet.Ident.User.Lib`
[🔗](https://github.com/srevenant/rivet-ident/blob/main/lib/ident/user/lib/index.ex#L1)

# `ecto_p_result`

```elixir
@type ecto_p_result() :: {:ok | :error, Ecto.Changeset.t()}
```

# `model_p_result`

```elixir
@type model_p_result() :: {:ok, Rivet.Ident.User.t()}
```

# `add_email`

# `add_phone`

# `all_since`

# `check_authz`

```elixir
@spec check_authz(user :: Rivet.Ident.User.t(), Rivet.Auth.Assertion.t()) ::
  {:ok | :error, Rivet.Ident.User.t()}
```

# `check_user_status`

# `clean_email`

```
iex> clean_email(" narf@narf.com.")
"narf@narf.com"
```

# `get_authz`

```elixir
@spec get_authz(user :: Rivet.Ident.User.t()) :: Rivet.Ident.User.t()
```

Bring in the list of authorized actions onto the user object (into :authz)

Only load once, if authz is nil

# `get_user`

```
iex> get_user("asdf")
{:error, :not_found}

iex> get_user("A73DD874-A724-494F-B9E2-2042A4383144")
{:error, :not_found}

iex> handle = insert(:ident_handle)
iex> {:ok, u} = get_user(handle.user_id)
iex> u.id
handle.user_id

iex> handle = insert(:ident_handle)
iex> {:ok, u} = get_user(handle.handle, [:handle])
iex> u.id
handle.user_id
```

# `get_user_by_handle`

# `has_other_admin?`

```elixir
@spec has_other_admin?(Rivet.Ident.Role.t(), Rivet.Ident.User.t()) ::
  boolean() | {:error, String.t()}
```

# `search`

# `search_name!`

# `user_seen`

# `with_user`

Helper function which accepts either user_id or user, and calls the passed
function with the user model loaded including any preloads.  Send preloads
as [] if none are desired.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
