Module: Gitlab::CurrentSettings
- Defined in:
- lib/gitlab/current_settings.rb
Class Method Summary collapse
- .clear_in_memory_application_settings! ⇒ Object
- .current_application_settings ⇒ Object
- .current_application_settings? ⇒ Boolean
- .expire_current_application_settings ⇒ Object
- .method_missing(name, *args, **kwargs, &block) ⇒ Object
- .respond_to_missing?(name, include_private = false) ⇒ Boolean
- .signup_disabled? ⇒ Boolean
- .signup_limited? ⇒ Boolean
Class Method Details
.clear_in_memory_application_settings! ⇒ Object
27 28 29 |
# File 'lib/gitlab/current_settings.rb', line 27 def clear_in_memory_application_settings! @in_memory_application_settings = nil end |
.current_application_settings ⇒ Object
14 15 16 |
# File 'lib/gitlab/current_settings.rb', line 14 def current_application_settings Gitlab::SafeRequestStore.fetch(:current_application_settings) { ensure_application_settings! } end |
.current_application_settings? ⇒ Boolean
18 19 20 |
# File 'lib/gitlab/current_settings.rb', line 18 def current_application_settings? Gitlab::SafeRequestStore.exist?(:current_application_settings) || ::ApplicationSetting.current.present? end |
.expire_current_application_settings ⇒ Object
22 23 24 25 |
# File 'lib/gitlab/current_settings.rb', line 22 def expire_current_application_settings ::ApplicationSetting.expire Gitlab::SafeRequestStore.delete(:current_application_settings) end |
.method_missing(name, *args, **kwargs, &block) ⇒ Object
31 32 33 |
# File 'lib/gitlab/current_settings.rb', line 31 def method_missing(name, *args, **kwargs, &block) current_application_settings.send(name, *args, **kwargs, &block) # rubocop:disable GitlabSecurity/PublicSend end |
.respond_to_missing?(name, include_private = false) ⇒ Boolean
35 36 37 |
# File 'lib/gitlab/current_settings.rb', line 35 def respond_to_missing?(name, include_private = false) current_application_settings.respond_to?(name, include_private) || super end |
.signup_disabled? ⇒ Boolean
6 7 8 |
# File 'lib/gitlab/current_settings.rb', line 6 def signup_disabled? !signup_enabled? end |
.signup_limited? ⇒ Boolean
10 11 12 |
# File 'lib/gitlab/current_settings.rb', line 10 def signup_limited? domain_allowlist.present? || email_restrictions_enabled? || require_admin_approval_after_user_signup? || user_default_external? end |