projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make activity announceable by its author.
[akkoma]
/
lib
/
pleroma
/
plugs
/
user_is_admin_plug.ex
diff --git
a/lib/pleroma/plugs/user_is_admin_plug.ex
b/lib/pleroma/plugs/user_is_admin_plug.ex
index a98c2c85314466af6fa3039555b1459904d6e371..4c4b3d610c15ec69e07cd7d2ea63b46d1bc4df68 100644
(file)
--- a/
lib/pleroma/plugs/user_is_admin_plug.ex
+++ b/
lib/pleroma/plugs/user_is_admin_plug.ex
@@
-1,8
+1,9
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-201
8
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-201
9
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserIsAdminPlug do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Plugs.UserIsAdminPlug do
+ import Pleroma.Web.TranslationHelpers
import Plug.Conn
alias Pleroma.User
import Plug.Conn
alias Pleroma.User
@@
-16,8
+17,7
@@
defmodule Pleroma.Plugs.UserIsAdminPlug do
def call(conn, _) do
conn
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
|> halt
end
end