Can you consider custom-extending list of actions that require model name in Canada.Can.can? implementation. (List is currently hard-coded to [:index, :new, :create]).
For authorize_resource plug, and perhaps for other plugs, this can be defined by inserting additional option, say require_model: [:custom_action1, :custom_action2, ...]
Then you can modify authorize_resource/2 function in plugs.ex. As follows round about line 195:
Can you consider custom-extending list of actions that require model name in Canada.Can.can? implementation. (List is currently hard-coded to [:index, :new, :create]). For authorize_resource plug, and perhaps for other plugs, this can be defined by inserting additional option, say require_model: [:custom_action1, :custom_action2, ...]
Then you can modify authorize_resource/2 function in plugs.ex. As follows round about line 195:
`
require_model_list = if opts[:require_model], do: ([:index, :new, :create] ++ opts[:require_model]), else: [:index, :new, :create] resource = cond do is_persisted -> fetch_resource(conn, opts)
action in [:index, :new, :create] ->
`
handle_not_found/2 may also need to be amended.