mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
fix rbac label assignment across orgs
* Org admins should not be able to attach labels to orgs for which they are not also org admins for.
This commit is contained in:
@@ -150,6 +150,18 @@ def instance(settings):
|
||||
def organization(instance):
|
||||
return Organization.objects.create(name="test-org", description="test-org-desc")
|
||||
|
||||
@pytest.fixture
|
||||
def organization_factory(instance):
|
||||
def factory(name):
|
||||
try:
|
||||
org = Organization.objects.get(name=name)
|
||||
except Organization.DoesNotExist:
|
||||
org = Organization.objects.create(name=name,
|
||||
description="description for " + name,
|
||||
)
|
||||
return org
|
||||
return factory
|
||||
|
||||
@pytest.fixture
|
||||
def credential():
|
||||
return Credential.objects.create(kind='aws', name='test-cred')
|
||||
|
||||
Reference in New Issue
Block a user