Rivet.Ident.Access.Lib (rivet_ident v3.5.0)

View Source

Summary

Types

ecto_p_result()

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

model_p_result()

@type model_p_result() :: {:ok, Rivet.Ident.Access.t()}

Functions

add(user, role, domain \\ :global, ref_id \\ nil)

@spec add(Rivet.Ident.User.t() | String.t(), atom(), atom(), String.t() | nil) ::
  {:ok, Rivet.Ident.Access.t()} | {:error, String.t()}

delete_user_access(user_id)

delete_user_domain(user_id, domain, ref_id)

drop(user, role_atom, domain \\ :global, ref_id \\ nil)

@spec drop(Rivet.Ident.User.t(), atom(), atom(), String.t() | nil) ::
  {:ok, Rivet.Ident.Access.t()} | {:error, String.t()}

get_actions(user)

@spec get_actions(Rivet.Ident.User.t()) :: MapSet.t()

Fold a list of accesses into a set of actions, using memory cache

get_actions(user, domain, ref_id)

@spec get_actions(Rivet.Ident.User.t(), domain :: atom(), ref_id :: binary()) ::
  MapSet.t()