# HG changeset patch # User Martin Bornhold # Date 2016-08-01 13:29:37 # Node ID c499f7782e5c9a95b45f7842260094e5c9e532a7 # Parent 959aac9f6452ec763c6a743d6b57bfd65410345e vcs: Add method to utils which returnd the rhodecode realm for HTTP basic auth. diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -475,6 +475,15 @@ def set_rhodecode_config(config): config[k] = v +def get_rhodecode_realm(): + """ + Return the rhodecode realm from database. + """ + from rhodecode.model.settings import SettingsModel + realm = SettingsModel().get_setting_by_name('realm') + return safe_str(realm.app_settings_value) + + def map_groups(path): """ Given a full path to a repository, create all nested groups that this