Split timeline_preview setting into more granular settings (#36338)
This commit is contained in:
17
app/controllers/api/v1/timelines/topic_controller.rb
Normal file
17
app/controllers/api/v1/timelines/topic_controller.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Timelines::TopicController < Api::V1::Timelines::BaseController
|
||||
before_action :require_user!, if: :require_auth?
|
||||
|
||||
private
|
||||
|
||||
def require_auth?
|
||||
if truthy_param?(:local)
|
||||
Setting.local_topic_feed_access != 'public'
|
||||
elsif truthy_param?(:remote)
|
||||
Setting.remote_topic_feed_access != 'public'
|
||||
else
|
||||
Setting.local_topic_feed_access != 'public' || Setting.remote_topic_feed_access != 'public'
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user