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:
Chris Meyers
2016-04-05 16:03:46 -04:00
parent be0ee97fb3
commit d69b9fad8f
3 changed files with 31 additions and 2 deletions

View File

@@ -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')