Rajska v1.0.2 Rajska.Authorization behaviour View Source

Behaviour of an Authorization module.

Link to this section Summary

Link to this section Types

Link to this type

context()

View Source
context() :: map()
Link to this type

current_user()

View Source
current_user() :: any()
Link to this type

current_user_role()

View Source
current_user_role() :: role()
Link to this type

scoped_struct()

View Source
scoped_struct() :: struct()

Link to this section Callbacks

Link to this callback

context_role_authorized?(context, allowed_role)

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

context_user_authorized?(context, scoped_struct, rule)

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

get_current_user(context)

View Source (optional)
get_current_user(context()) :: current_user()
Link to this callback

get_ip(context)

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

get_user_role(current_user)

View Source (optional)
get_user_role(current_user()) :: role()
Link to this callback

has_user_access?(current_user, scoped_struct, rule)

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

not_scoped_roles()

View Source (optional)
not_scoped_roles() :: [role()]
Link to this callback

role_authorized?(current_user_role, allowed_role)

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

unauthorized_message(resolution)

View Source (optional)
unauthorized_message(resolution :: Absinthe.Resolution.t()) :: String.t()