Rajska.Authorization behaviour (Rajska v1.3.2) View Source

Behaviour of an Authorization module.

Link to this section Summary

Link to this section Types

Specs

context() :: map()

Specs

current_user() :: any()

Specs

current_user_role() :: role()

Specs

role() :: atom()

Specs

rule() :: atom()

Specs

scoped_struct() :: struct()

Link to this section Callbacks

Link to this callback

context_role_authorized?(context, allowed_role)

View Source (optional)

Specs

context_role_authorized?(context(), allowed_role :: role()) :: boolean()
Link to this callback

context_user_authorized?(context, scoped_struct, rule)

View Source (optional)

Specs

context_user_authorized?(context(), scoped_struct(), rule()) :: boolean()
Link to this callback

get_current_user(context)

View Source (optional)

Specs

get_current_user(context()) :: current_user()
Link to this callback

get_ip(context)

View Source (optional)

Specs

get_ip(context()) :: String.t()
Link to this callback

get_user_role(current_user)

View Source (optional)

Specs

get_user_role(current_user()) :: role()
Link to this callback

has_user_access?(current_user, scoped_struct, rule)

View Source (optional)

Specs

has_user_access?(current_user(), scoped_struct(), rule()) :: boolean()
Link to this callback

not_scoped_roles()

View Source (optional)

Specs

not_scoped_roles() :: [role()]
Link to this callback

role_authorized?(current_user_role, allowed_role)

View Source (optional)

Specs

role_authorized?(current_user_role(), allowed_role :: role()) :: boolean()
Link to this callback

unauthorized_field_message(resolution, atom)

View Source (optional)

Specs

unauthorized_field_message(resolution :: Absinthe.Resolution.t(), atom()) ::
  String.t()
Link to this callback

unauthorized_message(resolution)

View Source (optional)

Specs

unauthorized_message(resolution :: Absinthe.Resolution.t()) ::
  String.t() | map() | list()
Link to this callback

unauthorized_object_message(resolution, arg2)

View Source (optional)

Specs

unauthorized_object_message(
  resolution :: Absinthe.Resolution.t(),
  Absinthe.Type.Object.t()
) ::
  String.t()
Link to this callback

unauthorized_object_scope_message(object_result, atom)

View Source (optional)

Specs

unauthorized_object_scope_message(
  object_result :: Absinthe.Blueprint.Result.Object.t(),
  atom()
) ::
  String.t()
Link to this callback

unauthorized_query_scope_message(resolution, atom)

View Source (optional)

Specs

unauthorized_query_scope_message(resolution :: Absinthe.Resolution.t(), atom()) ::
  String.t()