forked from AkkomaGang/akkoma
17 lines
292 B
Elixir
17 lines
292 B
Elixir
defmodule Pleroma.Plugs.UserIsAdminPlug do
|
|
import Plug.Conn
|
|
alias Pleroma.User
|
|
|
|
def init(options) do
|
|
options
|
|
end
|
|
|
|
def call(%{assigns: %{user: %User{info: %{"is_admin" => false}}}} = conn, _) do
|
|
conn
|
|
|> assign(:user, nil)
|
|
end
|
|
|
|
def call(conn, _) do
|
|
conn
|
|
end
|
|
end
|