X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fconfig.ex;h=97f87759554f325192b315222444a5f8fc6840bb;hb=c7bcbfbc1d5d34463634e44979a77a2c47e35dbc;hp=a8329cc1efbda910a5a0de6dda0068996d5b7d27;hpb=34cbe9f44a0266cd5ec652c3e70021ef928a7f31;p=akkoma diff --git a/lib/pleroma/config.ex b/lib/pleroma/config.ex index a8329cc1e..97f877595 100644 --- a/lib/pleroma/config.ex +++ b/lib/pleroma/config.ex @@ -81,6 +81,16 @@ defmodule Pleroma.Config do Application.delete_env(:pleroma, key) end + def restrict_unauthenticated_access?(resource, kind) do + setting = get([:restrict_unauthenticated, resource, kind]) + + if setting in [nil, :if_instance_is_private] do + !get!([:instance, :public]) + else + setting + end + end + def oauth_consumer_strategies, do: get([:auth, :oauth_consumer_strategies], []) def oauth_consumer_enabled?, do: oauth_consumer_strategies() != []