mirror of
https://github.com/ansible/awx.git
synced 2026-07-09 07:18:05 -02:30
also limit creation of system auditors to superusers
squash
This commit is contained in:
@@ -75,3 +75,16 @@ def test_org_user_removed(user, organization):
|
||||
|
||||
organization.member_role.members.remove(member)
|
||||
assert admin not in member.admin_role
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_org_admin_create_sys_auditor(org_admin):
|
||||
access = UserAccess(org_admin)
|
||||
assert not access.can_add(data=dict(
|
||||
username='new_user', password="pa$$sowrd", email="asdf@redhat.com",
|
||||
is_system_auditor='true'))
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_org_admin_edit_sys_auditor(org_admin, alice, organization):
|
||||
organization.member_role.members.add(alice)
|
||||
access = UserAccess(org_admin)
|
||||
assert not access.can_change(obj=alice, data=dict(is_system_auditor='true'))
|
||||
|
||||
Reference in New Issue
Block a user