View Source Mobilizon.Admin (Mobilizon v4.1.0-alpha.1)

The Admin context.

Summary

Functions

Link to this function

create_action_log(attrs \\ %{})

View Source
@spec create_action_log(map()) ::
  {:ok, Mobilizon.Admin.ActionLog.t()} | {:error, Ecto.Changeset.t()}

Creates a action_log.

Link to this function

get_admin_setting_value(group, name, fallback \\ nil)

View Source
@spec get_admin_setting_value(String.t(), String.t(), String.t() | nil) ::
  String.t() | boolean() | nil | map() | list()
Link to this function

get_all_admin_settings()

View Source
@spec get_all_admin_settings() :: [Mobilizon.Admin.Setting.t()]
Link to this function

get_setting_value(value)

View Source
@spec get_setting_value(String.t() | nil) ::
  map() | list() | nil | boolean() | String.t()
Link to this function

list_action_logs(page \\ nil, limit \\ nil)

View Source
@spec list_action_logs(integer() | nil, integer() | nil) ::
  Mobilizon.Storage.Page.t(Mobilizon.Admin.ActionLog.t())

Returns the list of action logs.

Link to this function

log_action(actor, action, target)

View Source
@spec log_action(Mobilizon.Actors.Actor.t(), String.t(), struct()) ::
  {:ok, Mobilizon.Admin.ActionLog.t()}
  | {:error, Ecto.Changeset.t() | :user_not_moderator}

Log an admin action

Link to this function

save_settings(group, args)

View Source
@spec save_settings(String.t(), map()) :: {:ok, any()} | {:error, any()}