cpjk / canary

:hatching_chick: Elixir authorization and resource-loading library for Plug applications.
MIT License
474 stars 51 forks source link

Conflict with `conn.assigns.action` and unrelated resource #24

Closed timoteus closed 9 years ago

timoteus commented 9 years ago

The check in get_action:

  defp get_action(conn) do
    conn.assigns
    |> Map.fetch(:action)
    |> case do
      {:ok, action} -> action
      _             -> conn.private.phoenix_action
    end
  end

wrongfully assumes that an unrelated resource conn.assigns.action is me specifying the action manually :wink:

Maybe use a namespace (i.e. canary_action) or a different name (i.e. controller_action, router_action) or something? conn.assigns.action is rather generic!

cpjk commented 9 years ago

I agree! Merged :smiley: