Closed will-moore closed 1 year ago
@jburel - This seems to be working to allow the editing of your current group.
If you're only a member of 1 group then editing it will fail, since you don't have any other groups you can switch to. This will already fail with the ValidationException reported above, but I guess we could also improve that error message.
Otherwise, editing should "just work".
Based on my understanding of the semantics of the Web admin UIm the ability to edit a group is restricted to admins in OMERO.web. If so, shouldn't this user always be member of at least the system
group as per its admin privileges and could we make use of this assumption?
@sbesson Yes, you're correct. Group owners have a Edit Group form, but that only handles permissions (not group renaming etc).
So I can just use the system group for self.setGroupForSession(groupId)
.
A sysadmin who editing the sysadmin group doesn't need to switch context since we can't rename the group (form doesn't allow it) and editing the description doesn't cause any exception.
Updated in 04e9538
Test 1 on merge-ci:
Test 2 latest-ci (trying to repeat the error which this PR is attempting to fix):
Fixes #163.
This uses
setGroupForSession()
to temporarily switch to a different group if a user tries to edit their current group.To test:
omero login
as an Admin which will show the name of your current group