Comment 0 for bug 1170649

Given a project with multiple users with a role in that project. Then I choose 1 user from that project, and then I remove ALL roles of that user from the project. This action kicks out all the users from that project.

Based on mysql logs. Removing the role of the user executes this command:
DELETE FROM user_project_metadata WHERE user_project_metadata.project_id = '430713609fad4216a3b72cf080eba006';

Patch for this bug:

--- a/keystone/identity/backends/
+++ b/keystone/identity/backends/
@@ -435,6 +435,7 @@ class Identity(sql.Base, identity.Driver):
                 session = self.get_session()
                 q = session.query(UserProjectGrant)
                 q = q.filter_by(project_id=tenant_id)
+               q = q.filter_by(user_id=user_id)