Unverified Commit 5a97e4fc authored by John Chilton's avatar John Chilton Committed by GitHub
Browse files

Merge pull request #6771 from mvdbeek/fix_private_role_none

[18.05] Use UserRoleAssociation to get private roles
parents 02c17715 2d9b8030
......@@ -766,7 +766,8 @@ class GalaxyRBACAgent(RBACAgent):
def get_private_user_role(self, user, auto_create=False):
role = self.sa_session.query(self.model.Role) \
.filter(and_(self.model.Role.table.c.name == user.email,
.filter(and_(self.model.UserRoleAssociation.table.c.user_id == user.id,
self.model.Role.table.c.id == self.model.UserRoleAssociation.table.c.role_id,
self.model.Role.table.c.type == self.model.Role.types.PRIVATE)) \
.first()
if not role:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment