authy v0.1.1 Authy.Controller
Import this in your Phoenix or Plug application controller to gain convenience macros for doing authorization.
Summary
Macros
Authorizes the controller action for the current user and executes the given block if successful
Scopes the current resource based on the action and user
Macros
Authorizes the controller action for the current user and executes the given block if successful.
def index(conn, _params) do
authorize Post do
# ...
end
end
def show(conn, %{id: id}) do
post = Repo.get(Post, id)
authorize post do
# ...
end
end