Sort of - get_roles_for_user_and_project(user_id, tenant_id) is a manager method, not a driver method. But loops over the results of a driver call to list_groups_for_user() because the driver method it really needs doesn't actually exist (something to provide _get_group_project_roles() in a single driver call). So, the for loop could be factored out into the base driver class as a *new* method, and then the LDAP, SQL and KVS implementations could override it with much more efficient methods.
Sort of - get_roles_ for_user_ and_project( user_id, tenant_id) is a manager method, not a driver method. But loops over the results of a driver call to list_groups_ for_user( ) because the driver method it really needs doesn't actually exist (something to provide _get_group_ project_ roles() in a single driver call). So, the for loop could be factored out into the base driver class as a *new* method, and then the LDAP, SQL and KVS implementations could override it with much more efficient methods.