Skip to content

Commit

Permalink
Use system group context for editing other groups
Browse files Browse the repository at this point in the history
  • Loading branch information
will-moore committed May 12, 2023
1 parent 4491c05 commit 04e9538
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions omeroweb/webclient/webclient_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,16 +1480,12 @@ def updateGroup(self, group, name, permissions, description=None):
temp_switch = False
if self.getEventContext().groupId == group.id:
# we can't update the current group
# find a group to temp switch to...
gids = [
gid
for gid in self.getEventContext().memberOfGroups
if (gid != 0 and gid != group.id)
]
if len(gids) == 0:
return ["You can't edit your current group!"]
self.setGroupForSession(gids[0])
temp_switch = True
# unless it's the system group (form won't include name change)
sys_id = self.getAdminService().getSecurityRoles().systemGroupId
if self.getEventContext().groupId != sys_id:
# otherwise, temp switch to allow editing of 'current' group
self.setGroupForSession(sys_id)
temp_switch = True

msgs = []
try:
Expand Down

0 comments on commit 04e9538

Please sign in to comment.