mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 17:37:37 -02:30
Revert "filter internal User.admin_roles from the /roles API list view"
This reverts commit 2a55bfa5741e91c466570e7b4cf9b517d366c610.
This commit is contained in:
@@ -389,11 +389,7 @@ class Role(models.Model):
|
|||||||
)
|
)
|
||||||
''' % sql_params]
|
''' % sql_params]
|
||||||
)
|
)
|
||||||
|
return qs
|
||||||
# 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)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@check_singleton
|
@check_singleton
|
||||||
|
|||||||
@@ -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 Role.singleton(ROLE_SINGLETON_SYSTEM_ADMINISTRATOR).id in role_hash
|
||||||
assert organization.admin_role.id in role_hash
|
assert organization.admin_role.id in role_hash
|
||||||
assert organization.member_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 custom_role.id in role_hash
|
||||||
|
|
||||||
assert inventory.admin_role.id not in role_hash
|
assert inventory.admin_role.id not in role_hash
|
||||||
|
|||||||
Reference in New Issue
Block a user