summaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2019-10-07 02:14:45 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2019-10-07 02:14:45 +0000
commitb4f3c16885a489c40de82e5ef321caafa4b10c81 (patch)
treee81e3d7ba6882b31bd18c221f872049af73e44f2 /lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
parent25cffffaf1685ef02cd318bdbd99bb325d295458 (diff)
parentb93856874de673f1c05c557ad482d4480ca7e0a7 (diff)
downloadpleroma-b4f3c16885a489c40de82e5ef321caafa4b10c81.tar.gz
pleroma-b4f3c16885a489c40de82e5ef321caafa4b10c81.zip
Merge branch '1234-mastodon-2-4-3-oauth-scopes' into 'develop'
[#1234] Mastodon 2.4.3 hierarchical OAuth scopes Closes #1234 See merge request pleroma/pleroma!1643
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
index 9076bb849..fe71c36af 100644
--- a/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/suggestion_controller.ex
@@ -8,11 +8,16 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionController do
require Logger
alias Pleroma.Config
+ alias Pleroma.Plugs.OAuthScopesPlug
alias Pleroma.User
alias Pleroma.Web.MediaProxy
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
+ plug(OAuthScopesPlug, %{scopes: ["read"]} when action == :index)
+
+ plug(Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug)
+
@doc "GET /api/v1/suggestions"
def index(%{assigns: %{user: user}} = conn, _) do
if Config.get([:suggestions, :enabled], false) do