X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fadmin_api%2Fcontrollers%2Fstatus_controller.ex;h=7058def82b8ab1f4397ef242746b1a980946e951;hb=c4b4258374e73ca4a6e3f3b30e3a8dad0ce40039;hp=c91fbc771ce25b0f9ddccb233043a6adc8c6c8ff;hpb=cd2abcc0e3a67898fbadd073ff778e7342c09709;p=akkoma
diff --git a/lib/pleroma/web/admin_api/controllers/status_controller.ex b/lib/pleroma/web/admin_api/controllers/status_controller.ex
index c91fbc771..7058def82 100644
--- a/lib/pleroma/web/admin_api/controllers/status_controller.ex
+++ b/lib/pleroma/web/admin_api/controllers/status_controller.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.AdminAPI.StatusController do
@@ -7,19 +7,19 @@ defmodule Pleroma.Web.AdminAPI.StatusController do
alias Pleroma.Activity
alias Pleroma.ModerationLog
- alias Pleroma.Plugs.OAuthScopesPlug
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.Web.CommonAPI
alias Pleroma.Web.MastodonAPI
+ alias Pleroma.Web.Plugs.OAuthScopesPlug
require Logger
plug(Pleroma.Web.ApiSpec.CastAndValidate)
- plug(OAuthScopesPlug, %{scopes: ["read:statuses"], admin: true} when action in [:index, :show])
+ plug(OAuthScopesPlug, %{scopes: ["admin:read:statuses"]} when action in [:index, :show])
plug(
OAuthScopesPlug,
- %{scopes: ["write:statuses"], admin: true} when action in [:update, :delete]
+ %{scopes: ["admin:write:statuses"]} when action in [:update, :delete]
)
action_fallback(Pleroma.Web.AdminAPI.FallbackController)
@@ -29,11 +29,11 @@ defmodule Pleroma.Web.AdminAPI.StatusController do
def index(%{assigns: %{user: _admin}} = conn, params) do
activities =
ActivityPub.fetch_statuses(nil, %{
- "godmode" => params.godmode,
- "local_only" => params.local_only,
- "limit" => params.page_size,
- "offset" => (params.page - 1) * params.page_size,
- "exclude_reblogs" => not params.with_reblogs
+ godmode: params.godmode,
+ local_only: params.local_only,
+ limit: params.page_size,
+ offset: (params.page - 1) * params.page_size,
+ exclude_reblogs: not params.with_reblogs
})
render(conn, "index.json", activities: activities, as: :activity)
@@ -41,9 +41,7 @@ defmodule Pleroma.Web.AdminAPI.StatusController do
def show(conn, %{id: id}) do
with %Activity{} = activity <- Activity.get_by_id(id) do
- conn
- |> put_view(Pleroma.Web.AdminAPI.StatusView)
- |> render("show.json", %{activity: activity})
+ render(conn, "show.json", %{activity: activity})
else
nil -> {:error, :not_found}
end