2021-03-19 19:32:18 +00:00
|
|
|
defmodule Legendary.AuthWeb.Helpers do
|
2020-10-09 22:08:28 +00:00
|
|
|
def has_role?(conn = %Plug.Conn{}, role) do
|
|
|
|
conn
|
|
|
|
|> Pow.Plug.current_user()
|
2021-03-19 19:32:18 +00:00
|
|
|
|> Legendary.Auth.Roles.has_role?(role)
|
2020-10-09 22:08:28 +00:00
|
|
|
end
|
|
|
|
end
|