/** * Provides an {@link EventContext} instance without reloading the session, * via {@link LocalAdmin#getEventContextQuiet()}. * @return the event context */ public EventContext getEventContext() { final LocalAdmin admin = (LocalAdmin) sf.getAdminService(); final EventContext ec = admin.getEventContextQuiet(); return ec; } }
@Transactional(readOnly = true) public Object doWork(Session session, ServiceFactory sf) { return ((LocalAdmin) sf.getAdminService()).getEventContextQuiet(); } });
@Transactional(readOnly=true) public Object doWork(Session session, ServiceFactory sf) { return ((LocalAdmin) sf.getAdminService()).getEventContextQuiet(); } });
@Transactional(readOnly = true) public Object doWork(Session session, ServiceFactory sf) { return ((LocalAdmin) sf.getAdminService()).getEventContextQuiet(); } });
@Transactional(readOnly=true) public Object doWork(org.hibernate.Session session, ServiceFactory sf) { return ((LocalAdmin) sf.getAdminService()).getEventContextQuiet(); } });
@Transactional(readOnly = false) public Object doWork(Session session, ServiceFactory sf) { try { EventContext ec = ((LocalAdmin) sf.getAdminService()) .getEventContextQuiet(); Deletion d = executor.getContext().getBean( Deletion.class.getName(), Deletion.class); final SetMultimap<String, Long> toDelete = HashMultimap.create(); toDelete.put("OriginalFile", id); d.deleteFiles(toDelete); return null; } catch (ome.conditions.ValidationException ve) { log.debug("ValidationException on delete", ve); } catch (Throwable e) { log.warn("Throwable while deleting script " + id, e); } return null; }
@Transactional(readOnly=true) public Object doWork(Session session, ServiceFactory sf) { LocalAdmin admin = (LocalAdmin) sf.getAdminService(); EventContext ec = admin.getEventContextQuiet(); long guestId = admin.getSecurityRoles().getGuestId(); return ec.getCurrentUserId().equals(guestId); } });
@Transactional(readOnly = false) public Object doWork(Session session, ServiceFactory sf) { final ome.system.EventContext eventContext; if (effectiveEventContext == null) { eventContext = ((LocalAdmin) sf.getAdminService()).getEventContextQuiet(); } else { eventContext = effectiveEventContext; /* sudo */ } for (CheckedPath checked : dirs) { try { repo.makeDir(checked, parents, session, sf, getSqlAction(), eventContext); } catch (ServerError se) { throw new Rethrow(se); } } return null; } });
.getAdminService()).getEventContextQuiet(); if (!ec.isCurrentUserAdmin()) { throw helper.cancel(new ERR(), null, "no-permissions",