'List role assignments to user and groups on domains and projects.
Return a list of all existing role assignments in the system, filtered
by assignments attributes, if provided.
If effective option is used and OS-INHERIT extension is enabled, the
following functions will be applied:
1) For any group role assignment on a target, replace it by a set of
role assignments containing one for each user of that group on that
target;
2) For any inherited role assignment for an actor on a target, replace
it by a set of role assignments for that actor on every project under
that target.
It means that, if effective mode is used, no group or domain inherited
assignments will be present in the resultant list. Thus, combining
effective with them is invalid.
As a role assignment contains only one actor and one target, providing
both user and group ids or domain and project ids is invalid as well.'

def _list_role_assignments(self, request, filters, include_subtree=False):

    params = request.params
    effective = (('effective' in params) and self.query_filter_is_true(params['effective']))
    include_names = (('include_names' in params) and self.query_filter_is_true(params['include_names']))
    if ('scope.OS-INHERIT:inherited_to' in params):
        inherited = (params['scope.OS-INHERIT:inherited_to'] == 'projects')
    else:
        inherited = None
    self._assert_domain_nand_project(params.get('scope.domain.id'), params.get('scope.project.id'))
    self._assert_user_nand_group(params.get('user.id'), params.get('group.id'))
    if effective:
        self._assert_effective_filters(inherited=inherited, group=params.get('group.id'), domain=params.get('scope.domain.id'))
    refs = self.assignment_api.list_role_assignments(role_id=params.get('role.id'), user_id=params.get('user.id'), group_id=params.get('group.id'), domain_id=params.get('scope.domain.id'), project_id=params.get('scope.project.id'), include_subtree=include_subtree, inherited=inherited, effective=effective, include_names=include_names)
    formatted_refs = [self._format_entity(request.context_dict, ref) for ref in refs]
    return self.wrap_collection(request.context_dict, formatted_refs)
