From b11f5c301584a440fee109fbe17bc0447ded493e Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Tue, 25 Oct 2016 13:40:15 -0400 Subject: [PATCH] Revert "filter internal User.admin_roles from the /roles API list view" This reverts commit 2a55bfa5741e91c466570e7b4cf9b517d366c610. --- awx/main/models/rbac.py | 6 +----- awx/main/tests/functional/test_rbac_api.py | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/awx/main/models/rbac.py b/awx/main/models/rbac.py index be724069d7..5e040b85a1 100644 --- a/awx/main/models/rbac.py +++ b/awx/main/models/rbac.py @@ -389,11 +389,7 @@ class Role(models.Model): ) ''' % sql_params] ) - - # Do not show roles that are of content_type(User) - # these roles are for internal only user. - user_type = ContentType.objects.get_for_model(User) - return qs.exclude(content_type__pk=user_type.id) + return qs @staticmethod @check_singleton diff --git a/awx/main/tests/functional/test_rbac_api.py b/awx/main/tests/functional/test_rbac_api.py index 0076c59c9e..54dcc8deb5 100644 --- a/awx/main/tests/functional/test_rbac_api.py +++ b/awx/main/tests/functional/test_rbac_api.py @@ -51,6 +51,7 @@ def test_get_roles_list_user(organization, inventory, team, get, user): assert Role.singleton(ROLE_SINGLETON_SYSTEM_ADMINISTRATOR).id in role_hash assert organization.admin_role.id in role_hash assert organization.member_role.id in role_hash + assert this_user.admin_role.id in role_hash assert custom_role.id in role_hash assert inventory.admin_role.id not in role_hash