@Override public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException, DataAccessException { Person p = userService.get(id); if (p == null) { throw new UsernameNotFoundException("User ID " + id + " not found."); } return new UserDetailsWrapper(p); }
@Override public UserDetails loadUserByUsername(String id) throws UsernameNotFoundException, DataAccessException { Person p = userService.get(id); if (p == null) { throw new UsernameNotFoundException("User ID " + id + " not found."); } return new UserDetailsWrapper(p); }
public Person getAuthenticatedUser() { SecurityContext ctx = SecurityContextHolder.getContext(); Authentication authn = ctx.getAuthentication(); if (authn != null && authn.getPrincipal() != null && authn.getPrincipal() instanceof Person) { Person loggedInUser = (Person) authn.getPrincipal(); if (loggedInUser != null && userService != null) { return userService.get(loggedInUser.getId()); } return loggedInUser; } return null; }
public Person getAuthenticatedUser() { SecurityContext ctx = SecurityContextHolder.getContext(); Authentication authn = ctx.getAuthentication(); if (authn != null && authn.getPrincipal() != null && authn.getPrincipal() instanceof Person) { Person loggedInUser = (Person) authn.getPrincipal(); if (loggedInUser != null && userService != null) { return userService.get(loggedInUser.getId()); } return loggedInUser; } return null; }
private Person getAuthenticatedUser() { SecurityContext ctx = SecurityContextHolder.getContext(); Authentication authn = ctx.getAuthentication(); if (manuallyAuthenticatedUser != null) { return manuallyAuthenticatedUser; } else { if (authn != null && authn.getPrincipal() != null && authn.getPrincipal() instanceof Person) { Person loggedInUser = (Person) authn.getPrincipal(); if (loggedInUser != null && userService != null) { return userService.get(loggedInUser.getId()); } return loggedInUser; } } return null; }
private Person getAuthenticatedUser() { SecurityContext ctx = SecurityContextHolder.getContext(); Authentication authn = ctx.getAuthentication(); if (manuallyAuthenticatedUser != null) { return manuallyAuthenticatedUser; } else { if (authn != null && authn.getPrincipal() != null && authn.getPrincipal() instanceof Person) { Person loggedInUser = (Person) authn.getPrincipal(); if (loggedInUser != null && userService != null) { return userService.get(loggedInUser.getId()); } return loggedInUser; } } return null; }
state.getBusinessObjectManager(), alternate_id_map); Person user = user_service.get(state.getIngestUserId());
state.getBusinessObjectManager(), alternate_id_map); Person user = user_service.get(state.getIngestUserId());
/** * returns creation activity for a collection * @param collection * @return activity */ private Activity retrieveCreationActivityForCollection(Collection collection){ DateTime depositDate = collection.getDepositDate(); Activity activity = new Activity(); Person actor = userService.get(collection.getDepositorId()); activity.setActor(actor); activity.setDateTimeOfOccurrence(new DateTime(depositDate.getYear(), depositDate.getMonthOfYear(), depositDate.getDayOfMonth(), depositDate.getHourOfDay(), depositDate.getMinuteOfHour(), depositDate.getSecondOfMinute())); activity.setType(Activity.Type.COLLECTION_DEPOSIT); activity.setCount(1); return activity; }
/** * returns creation activity for a collection * @param collection * @return activity */ private Activity retrieveCreationActivityForCollection(Collection collection){ DateTime depositDate = collection.getDepositDate(); Activity activity = new Activity(); Person actor = userService.get(collection.getDepositorId()); activity.setActor(actor); activity.setDateTimeOfOccurrence(new DateTime(depositDate.getYear(), depositDate.getMonthOfYear(), depositDate.getDayOfMonth(), depositDate.getHourOfDay(), depositDate.getMinuteOfHour(), depositDate.getSecondOfMinute())); activity.setType(Activity.Type.COLLECTION_DEPOSIT); activity.setCount(1); return activity; }
Person depositor = userService.get(ingestDetails.getPackageDepositorId()); if (depositor != null) { userId = depositor.getEmailAddress();
@Override public PasswordResetRequest create(Person person) throws PasswordResetServiceException { PasswordResetRequest passwordResetRequest = new PasswordResetRequest(); if(userService.get(person.getId()) != null){ passwordResetRequest.setUserEmailAddress(person.getEmailAddress()); passwordResetRequest.setRequestDate(DateTime.now()); passwordResetRequest.setId(UUID.randomUUID().toString()); } else { return null; } if(findActiveRequestsForUser(person).isEmpty()){ try{ passwordResetRequestDAO.add(passwordResetRequest); } catch (DuplicateKeyException e){ throw(new PasswordResetServiceException (e)); } catch (DataIntegrityViolationException e){ throw(new PasswordResetServiceException(e)); } log.debug("Creating PasswordResetRequest {}", passwordResetRequest); return passwordResetRequestDAO.get(passwordResetRequest.getId()); } else { return null; } }
for(DataItem ds : dataSetList){ Person depositor = userService.get(ds.getDepositorId()); if (countStructure.containsKey(depositor)){ countStructure.get(depositor).addDeposit(ds.getDepositDate());
@Override public PasswordResetRequest create(Person person) throws PasswordResetServiceException { PasswordResetRequest passwordResetRequest = new PasswordResetRequest(); if(userService.get(person.getId()) != null){ passwordResetRequest.setUserEmailAddress(person.getEmailAddress()); passwordResetRequest.setRequestDate(DateTime.now()); passwordResetRequest.setId(UUID.randomUUID().toString()); } else { return null; } if(findActiveRequestsForUser(person).isEmpty()){ try{ passwordResetRequestDAO.add(passwordResetRequest); } catch (DuplicateKeyException e){ throw(new PasswordResetServiceException (e)); } catch (DataIntegrityViolationException e){ throw(new PasswordResetServiceException(e)); } log.debug("Creating PasswordResetRequest {}", passwordResetRequest); return passwordResetRequestDAO.get(passwordResetRequest.getId()); } else { return null; } }
Person USuser = userService.get(user.getId());
Person USuser = userService.get(user.getId());
Person piPerson = userService.get(pi); relationshipService.addAdministratorToProject(project, piPerson);
Person piPerson = userService.get(pi); relationshipService.addAdministratorToProject(project, piPerson);
super.execute(depositId, state); Person user = userService.get(state.getIngestUserId()); if (user == null) {
super.execute(depositId, state); Person user = userService.get(state.getIngestUserId()); if (user == null) {