DEV: rename ReadOnly module to ReadOnlyHeader

This commit is contained in:
Régis Hanol
2019-05-06 16:07:49 +02:00
parent 33e06dd796
commit e2e72f4e8e
3 changed files with 7 additions and 7 deletions

13
lib/read_only_header.rb Normal file
View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
module ReadOnlyHeader
def check_readonly_mode
@readonly_mode = Discourse.readonly_mode?
end
def add_readonly_header
response.headers['Discourse-Readonly'] = 'true' if @readonly_mode
end
end