Request.Validator behaviour (RequestValidator v0.5.2) 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 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.