@SuppressWarnings({ "unchecked", "rawtypes" }) public SessionContextImpl(Session session, Set<AdminPrivilege> adminPrivileges, List<Long> lGroups, List<Long> mGroups, List<String> roles, SessionStats stats, Roles _roles, SessionContext previous) { this._roles = _roles; this.stats = stats; this.session = session; if (previous != null) { this.count = previous.count(); this.shareId = previous.getCurrentShareId(); } else { this.count = new SessionContext.Count(session.getUuid()); } this.adminPrivileges = ImmutableSet.copyOf(adminPrivileges); this.leaderOfGroups = Collections.unmodifiableList(new ArrayList( lGroups)); this.memberOfGroups = Collections.unmodifiableList(new ArrayList( mGroups)); this.roles = Collections.unmodifiableList(new ArrayList(roles)); // Force NPE getCurrentGroupPermissions(); }
/** * 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; }
final Long shareId = sc.getCurrentShareId(); final Long groupId = sc.getCurrentGroupId(); ome.model.IObject prevCtx = null;