Kantoor.Accounts.Scope (Kantoor v1.0.0)

The caller of a context function. Every context function that acts on behalf of a user takes a scope as its first argument.

Summary

Types

An application the identity provider says this person may open, as the switcher shows it (slug, name and launch URL; the icon is local to the application). Empty without the provider's shiloh_apps claim.

t()

Functions

True when the scope belongs to an admin.

Builds a scope for a user; nil for a missing or disabled user.

Types

app()

@type app() :: %{required(String.t()) => String.t()}

An application the identity provider says this person may open, as the switcher shows it (slug, name and launch URL; the icon is local to the application). Empty without the provider's shiloh_apps claim.

t()

@type t() :: %Kantoor.Accounts.Scope{
  apps: [app()],
  apps_admin?: boolean(),
  user: Kantoor.Accounts.User.t() | nil
}

Functions

admin?(arg1)

@spec admin?(t() | nil) :: boolean()

True when the scope belongs to an admin.

for_user(user)

@spec for_user(Kantoor.Accounts.User.t() | nil) :: t() | nil

Builds a scope for a user; nil for a missing or disabled user.