From 2011142ed9ae45f53496b3682da7114255c814a5 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Tue, 1 Sep 2020 10:43:44 -0500 Subject: [PATCH] Use :restrict_unauthenticated testing for more granular control --- lib/pleroma/web/feed/tag_controller.ex | 2 +- lib/pleroma/web/feed/user_controller.ex | 2 +- lib/pleroma/web/metadata.ex | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pleroma/web/feed/tag_controller.ex b/lib/pleroma/web/feed/tag_controller.ex index e090dd625..93a8294b7 100644 --- a/lib/pleroma/web/feed/tag_controller.ex +++ b/lib/pleroma/web/feed/tag_controller.ex @@ -10,7 +10,7 @@ defmodule Pleroma.Web.Feed.TagController do alias Pleroma.Web.Feed.FeedView def feed(conn, params) do - if Pleroma.Config.get!([:instance, :public]) do + unless Pleroma.Config.restrict_unauthenticated_access?(:activities, :local) do render_feed(conn, params) else render_error(conn, :not_found, "Not found") diff --git a/lib/pleroma/web/feed/user_controller.ex b/lib/pleroma/web/feed/user_controller.ex index 595889b9d..71eb1ea7e 100644 --- a/lib/pleroma/web/feed/user_controller.ex +++ b/lib/pleroma/web/feed/user_controller.ex @@ -38,7 +38,7 @@ defmodule Pleroma.Web.Feed.UserController do end def feed(conn, params) do - if Pleroma.Config.get!([:instance, :public]) do + unless Pleroma.Config.restrict_unauthenticated_access?(:profiles, :local) do render_feed(conn, params) else errors(conn, {:error, :not_found}) diff --git a/lib/pleroma/web/metadata.ex b/lib/pleroma/web/metadata.ex index 926b5b187..68835c826 100644 --- a/lib/pleroma/web/metadata.ex +++ b/lib/pleroma/web/metadata.ex @@ -46,7 +46,7 @@ defmodule Pleroma.Web.Metadata do end defp activated_providers do - if Pleroma.Config.get!([:instance, :public]) do + unless Pleroma.Config.restrict_unauthenticated_access?(:activities, :local) do Pleroma.Config.get([__MODULE__, :providers], []) else [] -- 2.45.2