discourse/lib/read_only.rb

14 lines
234 B
Ruby
Raw Normal View History

2019-05-03 18:21:07 +08:00
# frozen_string_literal: true
module ReadOnly
def check_readonly_mode
@readonly_mode = Discourse.readonly_mode?
end
def add_readonly_header
response.headers['Discourse-Readonly'] = 'true' if @readonly_mode
end
end