openmicroscopy/openmicroscopy — pull request #2664 by bpindelski (2014-06-20 12:40:42+00:00)
Title: Fix Share service (see #11537). (rebased onto develop)

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

----

This is an initial attempt of fixing the Share service, so that shares are again visible in the OMERO.web client and ``test_ishare.py`` doesn't fail. The problem with shares was caused by our Hibernate filtering applying extra ``WHERE`` clauses to the SQL query generated from HQL - the query always checked if the user using the share service is the owner of the share. That isn't true for share members (or guests). Hence queries returned an empty result.

A TODO list:
- [x] I'd like to clean up ``test_ishare.py`` and make it PEP8 compliant,
- ~~[ ] Maybe it's worth moving all queries from ``ShareBean.java`` and ``BlobShareStore.java`` to ``SqlAction.java``? That should guarantee that no unwanted filtering will happen.~~
- ~~[ ] Related to point above - some methods in ``ShareBean.java`` (e.g. ``getMemberCount()``) are still filtered, so there might be functionality/test failures in other places.~~

To test:
- verify that http://ci.openmicroscopy.org/job/OMERO-5.0-merge-integration-python/lastCompletedBuild/testReport/test.integration.test_ishare/TestIShare/ is passing and that there are no skipped tests (``xfail`` annotations have been removed),
- use web client and try to go through some of the share scenarios to check functionality.