diff options
author | Roger Rüttimann <roger.ruettimann@gmail.com> | 2018-08-30 12:53:06 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-08-30 12:53:06 +0000 |
commit | 93b9bfd93a841b7f86e6aeab3f9c5e9ede3a4503 (patch) | |
tree | 8bfec898a33d9b0b1693e73ce27a61db54881a66 /app/helpers/users_helper.rb | |
parent | 3113fb848001fdea3a039295002d7752b0feebbb (diff) | |
download | gitlab-ce-93b9bfd93a841b7f86e6aeab3f9c5e9ede3a4503.tar.gz |
Allow whitelisting for "external collaborator by default" setting
Diffstat (limited to 'app/helpers/users_helper.rb')
-rw-r--r-- | app/helpers/users_helper.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index ceea4384f91..2c0c4254a0c 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -23,6 +23,17 @@ module UsersHelper profile_tabs.include?(tab) end + def user_internal_regex_data + settings = Gitlab::CurrentSettings.current_application_settings + + pattern, options = if settings.user_default_internal_regex_enabled? + regex = settings.user_default_internal_regex_instance + JsRegex.new(regex).to_h.slice(:source, :options).values + end + + { user_internal_regex_pattern: pattern, user_internal_regex_options: options } + end + def current_user_menu_items @current_user_menu_items ||= get_current_user_menu_items end |