openmicroscopy/openmicroscopy — pull request #2272 by joshmoore (2014-04-09 06:48:06+00:00)
Title: Login as cli (rebased onto develop)

This is the same as gh-2183 but rebased onto develop.

----

This PR adds a flag `--sudo` to allow logging in as another user:
```
$ bin/omero login --sudo=root t@localhost
Using session 84eb7a3d-603e-478e-83cf-dd53b655e6e5 (t@localhost:4064). Current group: sudotest
$ bin/omero login -C --sudo=root t@localhost
Password for root:
Created session 8c5514e3-89a1-4946-ba5f-7521bd938b8b (t@localhost:4064). Current group: sudotest
$ cat $(bin/omero sessions file)
omero.sess=8c5514e3-89a1-4946-ba5f-7521bd938b8b
omero.user=t
omero.host=localhost
omero.sudo=root
```
Currently this functionality is limited to system administrators only. If possible as a part of this PR, I'd like to also allow the functionality for group owners.

* [x] Integration tests
* [ ] ~~Allow group owner creation (must prevent switch-group on such sessions)~~ (see https://github.com/openmicroscopy/openmicroscopy/pull/2183#issuecomment-39774801)
* [x] Documentation and an example of import-as.