mirror of
https://github.com/ansible/awx.git
synced 2026-01-09 23:12:08 -03:30
Add more 'auto-associate by posting new object' end points.
This commit is contained in:
parent
fa54f7ad66
commit
4aed4f6405
@ -207,4 +207,8 @@ class UsersTest(BaseTest):
|
||||
data = self.get(url, expect=200, auth=self.get_normal_credentials())
|
||||
self.assertEquals(data['count'], 0)
|
||||
|
||||
# FIXME: add test that shows posting a user w/o id to /organizations/2/users/ can create a new one & associate
|
||||
# FIXME: add test that shows posting a user w/o id to /organizations/2/admins/ can create a new one & associate
|
||||
# FIXME: add test that shows posting a projects w/o id to /organizations/2/projects/ can create a new one & associate
|
||||
|
||||
|
||||
|
||||
@ -85,6 +85,7 @@ class OrganizationsUsersList(BaseSubList):
|
||||
parent_model = Organization
|
||||
relationship = 'users'
|
||||
postable = True
|
||||
inject_primary_key_on_post_as = 'organization'
|
||||
|
||||
def _get_queryset(self):
|
||||
''' to list users in the organization, I must be a superuser or org admin '''
|
||||
@ -101,6 +102,7 @@ class OrganizationsAdminsList(BaseSubList):
|
||||
parent_model = Organization
|
||||
relationship = 'admins'
|
||||
postable = True
|
||||
inject_primary_key_on_post_as = 'organization'
|
||||
|
||||
def _get_queryset(self):
|
||||
''' to list admins in the organization, I must be a superuser or org admin '''
|
||||
@ -117,6 +119,7 @@ class OrganizationsProjectsList(BaseSubList):
|
||||
parent_model = Organization # for sub list
|
||||
relationship = 'projects' # " "
|
||||
postable = True
|
||||
inject_primary_key_on_post_as = 'organization'
|
||||
|
||||
def _get_queryset(self):
|
||||
''' to list projects in the organization, I must be a superuser or org admin '''
|
||||
@ -133,6 +136,7 @@ class OrganizationsTagsList(BaseSubList):
|
||||
parent_model = Organization # for sub list
|
||||
relationship = 'tags' # " "
|
||||
postable = True
|
||||
inject_primary_key_on_post_as = 'organization'
|
||||
|
||||
def _get_queryset(self):
|
||||
''' to list tags in the organization, I must be a superuser or org admin '''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user