@Transactional(readOnly = true) public Object doWork(org.hibernate.Session session, ServiceFactory sf) { // ticket:2088 - ShareBean does the pre-emptive check sf.getShareService().activate(id); return null; } });
@Transactional(readOnly = true) public Object doWork(Session session, ServiceFactory sf) { final IAdmin admin = sf.getAdminService(); final IShare share = sf.getShareService(); final List<ome.model.IObject> objs = new ArrayList<ome.model.IObject>(); // Groups final Set<Long> added = new HashSet<Long>(); for (Long id : ec.getMemberOfGroupsList()) { objs.add(admin.getGroup(id)); added.add(id); } for (Long id : ec.getLeaderOfGroupsList()) { if (!added.contains(id)) { objs.add(admin.getGroup(id)); } } // Shares objs.addAll(share.getMemberShares(true)); objs.addAll(share.getOwnShares(true)); return objs; } });
@Transactional(readOnly = true) public Object doWork(org.hibernate.Session session, ServiceFactory sf) { if (ec.getCurrentShareId() != null) { sf.getShareService().deactivate(); } SessionContext sc = cache.getSessionContext(principal.getName()); Session s = sc.getSession(); // Store old value for rollback if (!sc.isCurrentUserAdmin() && id >= 0 && !sc.getMemberOfGroupsList().contains(id)) { StringBuilder sb = new StringBuilder(); sb.append("User "); sb.append(sc.getCurrentUserId()); sb.append(" is not a member of group "); sb.append(id); throw new SecurityViolation(sb.toString()); } group[0] = s.getDetails().getGroup(); s.getDetails().setGroup(sf.getAdminService().getGroup(id)); return s; } });
Set<ome.model.meta.Session> shares1 = sh.getOwnShares(false); Set<ome.model.meta.Session> shares2 = sh.getMemberShares(false);