From 46020379aadac6607f8d8587c8f2ee442034063a Mon Sep 17 00:00:00 2001 From: Jeff Bradberry Date: Mon, 4 Feb 2019 11:45:27 -0500 Subject: [PATCH] Expose the known privilege escalation methods in the API config view so that the UI can obtain them and make use of them for an autocomplete widget. --- awx/api/views/root.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/api/views/root.py b/awx/api/views/root.py index 3699dc423a..c7ecbbeef5 100644 --- a/awx/api/views/root.py +++ b/awx/api/views/root.py @@ -27,6 +27,7 @@ from awx.main.utils import ( ) from awx.api.versioning import reverse, get_request_version, drf_reverse from awx.conf.license import get_license, feature_enabled +from awx.main.constants import PRIVILEGE_ESCALATION_METHODS from awx.main.models import ( Project, Organization, @@ -203,7 +204,8 @@ class ApiV1ConfigView(APIView): version=get_awx_version(), ansible_version=get_ansible_version(), eula=render_to_string("eula.md") if license_data.get('license_type', 'UNLICENSED') != 'open' else '', - analytics_status=pendo_state + analytics_status=pendo_state, + become_methods=PRIVILEGE_ESCALATION_METHODS, ) # If LDAP is enabled, user_ldap_fields will return a list of field