Skip to content

Commit

Permalink
Fix set of role names
Browse files Browse the repository at this point in the history
- Add user email to represent user's private role
- Exclude generic role names
  • Loading branch information
jdavcs committed Oct 25, 2024
1 parent 23d8f07 commit 5d7fdeb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/galaxy/files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,15 @@ def preferences(self):
def role_names(self) -> Set[str]:
"""The set of role names of this user."""
user = self.trans.user
return {ura.role.name for ura in user.roles} if user else set()
role_names = {ura.role.name for ura in user.roles} if user else set()
# Exclude generic role names
# TODO refactor to use Role.default_name (can't import Role)
sharing_role = "sharing role"
private_role = "private role"
role_names = role_names - {sharing_role, private_role}
# Add user email to identify their private role
role_names.add(user.email)
return role_names

@property
def group_names(self) -> Set[str]:
Expand Down

0 comments on commit 5d7fdeb

Please sign in to comment.