@Before(EXECUTION_SAVE)
	public void beforeSave(JoinPoint joinPoint) {
		for (Object object : joinPoint.getArgs()) {
			// If the object is base model and it's on the servlet
			// context, It's not executed by task scheduling.
			if (object instanceof BaseModel
					&& (springContext.isAuthenticationContext() || springContext.isUnitTestContext())) {
				BaseModel<?> model = (BaseModel<?>) object;
				Instant lastModifiedAt = now();
				model.setLastModifiedAt(lastModifiedAt);

				User currentUser = userContext.getCurrentUser();
				long currentUserId = currentUser.getId();

				model.setLastModifiedBy(userRepository.findOne(idEqual(currentUserId))
					.orElseThrow(() -> new IllegalArgumentException("No user found with id : " + currentUserId)));

				if (!model.exist() || model.getCreatedBy() == null) {
					long factualUserId = currentUser.getFactualUser().getId();
					model.setCreatedAt(lastModifiedAt);
					model.setCreatedBy(userRepository.findOne(idEqual(factualUserId))
						.orElseThrow(() -> new IllegalArgumentException("No user found with id : " + factualUserId)));
				}
			}
		}
	}
Inject the created/modified user and date to the model. It's only applied
in the servlet context.

@param joinPoint joint point
ngrinder-controller/src/main/java/org/ngrinder/common/service/ModelAspect.java