Include admins in nodeinfo
This commit is contained in:
parent
10248d86a2
commit
d1de0a30cc
@ -6,7 +6,6 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|
|||||||
use Pleroma.Web, :controller
|
use Pleroma.Web, :controller
|
||||||
|
|
||||||
alias Pleroma.Config
|
alias Pleroma.Config
|
||||||
alias Pleroma.Repo
|
|
||||||
alias Pleroma.Stats
|
alias Pleroma.Stats
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web
|
alias Pleroma.Web
|
||||||
@ -86,8 +85,7 @@ defmodule Pleroma.Web.Nodeinfo.NodeinfoController do
|
|||||||
end
|
end
|
||||||
|
|
||||||
staff_accounts =
|
staff_accounts =
|
||||||
User.moderator_user_query()
|
User.all_superusers()
|
||||||
|> Repo.all()
|
|
||||||
|> Enum.map(fn u -> u.ap_id end)
|
|> Enum.map(fn u -> u.ap_id end)
|
||||||
|
|
||||||
mrf_user_allowlist =
|
mrf_user_allowlist =
|
||||||
|
@ -8,7 +8,8 @@ defmodule Pleroma.Web.NodeInfoTest do
|
|||||||
import Pleroma.Factory
|
import Pleroma.Factory
|
||||||
|
|
||||||
test "nodeinfo shows staff accounts", %{conn: conn} do
|
test "nodeinfo shows staff accounts", %{conn: conn} do
|
||||||
user = insert(:user, %{local: true, info: %{is_moderator: true}})
|
moderator = insert(:user, %{local: true, info: %{is_moderator: true}})
|
||||||
|
admin = insert(:user, %{local: true, info: %{is_admin: true}})
|
||||||
|
|
||||||
conn =
|
conn =
|
||||||
conn
|
conn
|
||||||
@ -16,7 +17,8 @@ defmodule Pleroma.Web.NodeInfoTest do
|
|||||||
|
|
||||||
assert result = json_response(conn, 200)
|
assert result = json_response(conn, 200)
|
||||||
|
|
||||||
assert user.ap_id in result["metadata"]["staffAccounts"]
|
assert moderator.ap_id in result["metadata"]["staffAccounts"]
|
||||||
|
assert admin.ap_id in result["metadata"]["staffAccounts"]
|
||||||
end
|
end
|
||||||
|
|
||||||
test "nodeinfo shows restricted nicknames", %{conn: conn} do
|
test "nodeinfo shows restricted nicknames", %{conn: conn} do
|
||||||
|
Loading…
Reference in New Issue
Block a user