public Helper(Request request, Status status, SqlAction sql, Session session, ServiceFactory sf) { synchronized (status) { if (status.flags == null) { status.flags = new ArrayList<State>(); } } this.request = request; this.status = status; this.sql = sql; this.session = session; this.sf = sf; if (sf != null) { long userId = getEventContext().getCurrentUserId(); Roles roles = sf.getAdminService().getSecurityRoles(); isGuest = (userId == roles.getGuestId()); } this.log = LoggerFactory.getLogger( this.request.toString().replaceAll("@", ".@")); }
sql.append(" and g.id = :active "); p.addLong("active", helper.getServiceFactory().getAdminService() .getSecurityRoles().getUserGroupId());
@Transactional(readOnly = true) public Boolean doWork(Session session, ServiceFactory sf) { final OriginalFile file = new OriginalFile(); if (isIntoUserGroup) { final long userGroupId = sf.getAdminService().getSecurityRoles().getUserGroupId(); file.getDetails().setGroup((ome.model.meta.ExperimenterGroup) session.get(ome.model.meta.ExperimenterGroup.class, userGroupId)); } file.setRepo(scripts.getUuid()); /* check with interceptor */ try { interceptor.newTransientDetails(file); } catch (ome.conditions.SecurityViolation sv) { return false; } /* check with ACL voter */ file.setRepo(null); // can never create with repo set return aclVoter.allowCreation(file); } });
final long rootId = adminService.getSecurityRoles().getRootId(); if (currentEventContext.getCurrentUserId() == rootId) { pathsForRoot = ImmutableList.copyOf(paths);