1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-30 22:21:13 +03:00

add tests for clarified label permissions

This commit is contained in:
Ryan Petrello 2020-07-08 16:53:05 -04:00
parent a88f03b372
commit 7322e13436
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -20,8 +20,19 @@ def test_label_get_queryset_su(label, user):
@pytest.mark.django_db
def test_label_access(label, user):
def test_label_read_access(label, user):
access = LabelAccess(user('user', False))
assert not access.can_read(label)
label.organization.member_role.members.add(user('user', False))
assert access.can_read(label)
@pytest.mark.django_db
def test_label_jt_read_access(label, user, job_template):
access = LabelAccess(user('user', False))
assert not access.can_read(label)
job_template.read_role.members.add(user('user', False))
job_template.labels.add(label)
assert access.can_read(label)