X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fplugs%2Fuser_is_admin_plug.ex;h=4c4b3d610c15ec69e07cd7d2ea63b46d1bc4df68;hb=0a99f1e8c5551dcf170722e5087a0401b2d907af;hp=cf22ce5d064602926db32e0820ea636f250472bb;hpb=343b0adfa6c88f0934d788be0e59ea8a5fe483b1;p=akkoma diff --git a/lib/pleroma/plugs/user_is_admin_plug.ex b/lib/pleroma/plugs/user_is_admin_plug.ex index cf22ce5d0..4c4b3d610 100644 --- a/lib/pleroma/plugs/user_is_admin_plug.ex +++ b/lib/pleroma/plugs/user_is_admin_plug.ex @@ -1,4 +1,9 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Plugs.UserIsAdminPlug do + import Pleroma.Web.TranslationHelpers import Plug.Conn alias Pleroma.User @@ -12,8 +17,7 @@ defmodule Pleroma.Plugs.UserIsAdminPlug do def call(conn, _) do conn - |> put_resp_content_type("application/json") - |> send_resp(403, Jason.encode!(%{error: "User is not admin."})) + |> render_error(:forbidden, "User is not admin.") |> halt end end