ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
20 stars 33 forks source link

omero user add omename firstname lastname groupname #183

Open jburel opened 4 years ago

jburel commented 4 years ago

If the user exists and groups are specified. The default should be to join the group. Instead of throwing an error or returning without any actions. This makes the setup of tests for example more complicated that it has to be.

joshmoore commented 4 years ago

@jburel: you mean omero user add omename firstname lastname groupname? I'd suggest maybe only if --ignore-existing is passed because then there wouldn't be an error condition anyway.

jburel commented 4 years ago

I wrote error. I meant "die" I still think it is more useful to do a joingroup than terminate regardless of the option

joshmoore commented 4 years ago

I think that would be a surprise. I try to add a user "john" with password "foo" and the method is successful, but new John won't be able to log in and old John will now be in a new group.

jburel commented 4 years ago

True

manics commented 4 years ago

How about a better error message? Instead of User exists: user-10 (id=NNNM) Something like User <username> exists but isn't in the requested group, run "user joingroup ... <...>" to add them to the group?

mtbc commented 4 years ago

If accepted then could revert https://github.com/ome/openmicroscopy/pull/6217.

jburel commented 4 years ago

If we only change the message then the change won't be reverted if we do a joingroup when --ignore-existing is passed then we can revert