Module: Gitlab::CurrentSettings

Defined in:
lib/gitlab/current_settings.rb

Class Method Summary collapse

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_settingsObject



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

Returns:

  • (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_settingsObject



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

Returns:

  • (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

Returns:

  • (Boolean)


6
7
8
# File 'lib/gitlab/current_settings.rb', line 6

def 
  !
end

.signup_limited?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/gitlab/current_settings.rb', line 10

def 
  domain_allowlist.present? || email_restrictions_enabled? || require_admin_approval_after_user_signup? || user_default_external?
end