long spaceId = params.getLong("s", -1);
ItemSearch itemSearch = null;
if(spaceId > 0) {
Space space = jtrac.loadSpace(spaceId);
if(!user.isAllocatedToSpace(space.getId())) {
throw new JtracSecurityException("User not allocated to space: " + spaceId + " in URL: " + params);
}
itemSearch = new ItemSearch(space);
} else {
itemSearch = new ItemSearch(user);
}