Request.Validator behaviour (RequestValidator v0.8.1) View Source
Link to this section Summary
Callbacks
Determine if the user is authorized to make this request.
Get the validation rules that apply to the request.
Link to this section Types
Specs
validation_result() :: :ok | {:error, map()}
Link to this section Functions
Specs
validate(module(), map() | keyword(), keyword()) :: validation_result()
Link to this section Callbacks
Specs
authorize(Plug.Conn.t()) :: boolean()
Determine if the user is authorized to make this request.
def authorize(conn) do
user(conn).is_admin
end
Specs
rules(Plug.Conn.t()) :: keyword()
Get the validation rules that apply to the request.