1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Plugs.EnsureStaffPrivilegedPlug do
7 Ensures if staff are privileged enough to do certain tasks
10 import Pleroma.Web.TranslationHelpers
20 def call(%{assigns: %{user: %User{is_admin: true}}} = conn, _), do: conn
23 if Config.get!([:instance, :privileged_staff]) do
27 |> render_error(:forbidden, "User is not an admin.")