Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
record
workbench4record
Commits
2d9b8030
Commit
2d9b8030
authored
Sep 26, 2018
by
mvdbeek
Browse files
Use UserRoleAssociation to get private roles
If I understand this correctly this should work even if the user email changes.
parent
02c17715
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/galaxy/security/__init__.py
View file @
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment