schrockwell / bodyguard

Simple authorization conventions for Phoenix apps

Home Page:https://hexdocs.pm/bodyguard/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add plug for setting default options

schrockwell opened this issue · comments

Something like:

plug :bodyguard_options, policy: MyOtherPolicy

def index(conn, params) do
  authorize!(conn, action: :foo) # => opts is [policy: MyOtherPolicy, action: :foo]
end

Done, just needs a mention in the readme