Adding --as-default to CLI omero user joingroup #5914
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding a parameter to set a user's default group when joining a new group, and a helper function to set the default group for a user.
Ideally the CLI should also allow an ad-hoc "set group" command on it's own, but I see this as an incremental improvement towards that goal, and it certainly answers the use case I have for adding users to a group and setting that to be the default group in one command.
What this PR does
Allows a CLI user to set the default group of a user when adding the user to a group.
Testing this PR
Apply the diff in this PR.
Identify a group which your test user does not belong to.
Issue a CLI command with the new
--as-default
flag like so, with 103 as an example:Then issue a further
Output like the following should appear, if the user was not already a member of the group.
Then
Related reading
Link to cards, tickets, other PRs: https://trello.com/c/sjEk7VQG/487-cli-manage-group-and-user-missing-features
background for understanding this PR
what this PR assists, fixes, or otherwise affects
The missing ability to set the default group of a user by the CLI.