fix scopes plug

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2023-08-18 17:29:06 +02:00
parent d1d512bf1f
commit b5a1a152fc
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ defmodule Pleroma.Web.AdminAPI.ImportController do
alias Pleroma.Web.ApiSpec
alias Pleroma.Web.Plugs.OAuthScopesPlug
plug(OAuthScopesPlug, %{scopes: ["admin:write"]} when action == :collection)
plug(OAuthScopesPlug, %{scopes: ["admin:write"]} when action in [:collection, :archive])
plug(Pleroma.Web.ApiSpec.CastAndValidate)
defdelegate open_api_operation(action), to: ApiSpec.Admin.ImportOperation

View file

@ -14,7 +14,7 @@ defmodule Pleroma.Web.PleromaAPI.UserImportController do
plug(OAuthScopesPlug, %{scopes: ["follow", "write:follows"]} when action == :follow)
plug(OAuthScopesPlug, %{scopes: ["follow", "write:blocks"]} when action == :blocks)
plug(OAuthScopesPlug, %{scopes: ["follow", "write:mutes"]} when action == :mutes)
plug(OAuthScopesPlug, %{scopes: ["follow", "write:statuses"]} when action == :collection)
plug(OAuthScopesPlug, %{scopes: ["follow", "write:statuses"]} when action in [:collection, :archive])
plug(Pleroma.Web.ApiSpec.CastAndValidate, replace_params: false)
defdelegate open_api_operation(action), to: ApiSpec.UserImportOperation