Add include_subtree to role_list_assignments call
This is needed for Domain Admin to list role assignments. Related-Bug: 1437407 Depends-On: I3495c7cab3b40811b2722ac7d70ddda30410b62b Closes-Bug: #1462694 Change-Id: I63849d5f39d090fec3ef6b9182f339e198e0c551
This commit is contained in:

committed by
Dan Nguyen

parent
db54738eb9
commit
7ff3955665
@@ -121,6 +121,22 @@ class RoleAssignmentsTests(utils.TestCase, utils.CrudTests):
|
|||||||
kwargs = {'scope.project.id': self.TEST_TENANT_ID}
|
kwargs = {'scope.project.id': self.TEST_TENANT_ID}
|
||||||
self.assertQueryStringContains(**kwargs)
|
self.assertQueryStringContains(**kwargs)
|
||||||
|
|
||||||
|
def test_project_assignments_list_include_subtree(self):
|
||||||
|
ref_list = self.TEST_GROUP_PROJECT_LIST + self.TEST_USER_PROJECT_LIST
|
||||||
|
self.stub_entity('GET',
|
||||||
|
[self.collection_key,
|
||||||
|
'?scope.project.id=%s&include_subtree=True' %
|
||||||
|
self.TEST_TENANT_ID],
|
||||||
|
entity=ref_list)
|
||||||
|
|
||||||
|
returned_list = self.manager.list(project=self.TEST_TENANT_ID,
|
||||||
|
include_subtree=True)
|
||||||
|
self._assert_returned_list(ref_list, returned_list)
|
||||||
|
|
||||||
|
kwargs = {'scope.project.id': self.TEST_TENANT_ID,
|
||||||
|
'include_subtree': 'True'}
|
||||||
|
self.assertQueryStringContains(**kwargs)
|
||||||
|
|
||||||
def test_domain_assignments_list(self):
|
def test_domain_assignments_list(self):
|
||||||
ref_list = self.TEST_USER_DOMAIN_LIST
|
ref_list = self.TEST_USER_DOMAIN_LIST
|
||||||
self.stub_entity('GET',
|
self.stub_entity('GET',
|
||||||
|
@@ -47,7 +47,8 @@ class RoleAssignmentManager(base.CrudManager):
|
|||||||
raise exceptions.ValidationError(msg)
|
raise exceptions.ValidationError(msg)
|
||||||
|
|
||||||
def list(self, user=None, group=None, project=None, domain=None, role=None,
|
def list(self, user=None, group=None, project=None, domain=None, role=None,
|
||||||
effective=False, os_inherit_extension_inherited_to=None):
|
effective=False, os_inherit_extension_inherited_to=None,
|
||||||
|
include_subtree=False):
|
||||||
"""Lists role assignments.
|
"""Lists role assignments.
|
||||||
|
|
||||||
If no arguments are provided, all role assignments in the
|
If no arguments are provided, all role assignments in the
|
||||||
@@ -69,6 +70,7 @@ class RoleAssignmentManager(base.CrudManager):
|
|||||||
:param string os_inherit_extension_inherited_to:
|
:param string os_inherit_extension_inherited_to:
|
||||||
return inherited role assignments for either 'projects' or
|
return inherited role assignments for either 'projects' or
|
||||||
'domains'. (optional)
|
'domains'. (optional)
|
||||||
|
:param boolean include_subtree: Include subtree (optional)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self._check_not_user_and_group(user, group)
|
self._check_not_user_and_group(user, group)
|
||||||
@@ -90,6 +92,8 @@ class RoleAssignmentManager(base.CrudManager):
|
|||||||
if os_inherit_extension_inherited_to:
|
if os_inherit_extension_inherited_to:
|
||||||
query_params['scope.OS-INHERIT:inherited_to'] = (
|
query_params['scope.OS-INHERIT:inherited_to'] = (
|
||||||
os_inherit_extension_inherited_to)
|
os_inherit_extension_inherited_to)
|
||||||
|
if include_subtree:
|
||||||
|
query_params['include_subtree'] = include_subtree
|
||||||
|
|
||||||
return super(RoleAssignmentManager, self).list(**query_params)
|
return super(RoleAssignmentManager, self).list(**query_params)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user