/** * Set the share id on the current session context. * * Previously this method was used throughout the code base in order to * "open up" a session. This however, has issues since it can lead to data * leakage (8037). Using the omero.group functionality (3529), this method * no longer needs to be public. * * @see <a href="https://trac.openmicroscopy.org/ome/ticket/2219">ticket:2219</a> * @see <a href="https://trac.openmicroscopy.org/ome/ticket/3529">ticket:3529</a> * @see <a href="https://trac.openmicroscopy.org/ome/ticket/8037">ticket:8037</a> */ private Long setShareId(Long shareId) { String sessId = getSecuritySystem().getEventContext().getCurrentSessionUuid(); SessionContext sc = (SessionContext) sessionManager .getEventContext(new Principal(sessId)); Long old = sc.getCurrentShareId(); sc.setShareId(shareId); return old; }