'List role assignments, honoring effective mode and provided filters.
Returns a list of role assignments, where their attributes match the
provided filters (role_id, user_id, group_id, domain_id, project_id and
inherited). If include_subtree is True, then assignments on all
descendants of the project specified by project_id are also included.
The inherited filter defaults to None, meaning to get both
non-inherited and inherited role assignments.
If effective mode is specified, this means that rather than simply
return the assignments that match the filters, any group or
inheritance assignments will be expanded. Group assignments will
become assignments for all the users in that group, and inherited
assignments will be shown on the projects below the assignment point.
Think of effective mode as being the list of assignments that actually
affect a user, for example the roles that would be placed in a token.
If include_names is set to true the entities\' names are returned
in addition to their id\'s.
source_from_group_ids is a list of group IDs and, if specified, then
only those assignments that are derived from membership of these groups
are considered, and any such assignments will not be expanded into
their user membership assignments. This is different to a group filter
of the resulting list, instead being a restriction on which assignments
should be considered before expansion of inheritance. This option is
only used internally (i.e. it is not exposed at the API level) and is
only supported in effective mode (since in regular mode there is no
difference between this and a group filter, other than it is a list of
groups).
In effective mode, any domain specific roles are usually stripped from
the returned assignments (since such roles are not placed in tokens).
This stripping can be disabled by specifying strip_domain_roles=False,
which is useful for internal calls like trusts which need to examine
the full set of roles.'

def list_role_assignments(self, role_id=None, user_id=None, group_id=None, domain_id=None, project_id=None, include_subtree=False, inherited=None, effective=None, include_names=False, source_from_group_ids=None, strip_domain_roles=True):

    subtree_ids = None
    if (project_id and include_subtree):
        subtree_ids = [x['id'] for x in self.resource_api.list_projects_in_subtree(project_id)]
    if effective:
        role_assignments = self._list_effective_role_assignments(role_id, user_id, group_id, domain_id, project_id, subtree_ids, inherited, source_from_group_ids, strip_domain_roles)
    else:
        role_assignments = self._list_direct_role_assignments(role_id, user_id, group_id, domain_id, project_id, subtree_ids, inherited)
    if include_names:
        return self._get_names_from_role_assignments(role_assignments)
    return role_assignments
