mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-29 17:42:12 +08:00
Merge pull request #6771 from mvdbeek/fix_private_role_none
[18.05] Use UserRoleAssociation to get private roles
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user