Пример #1
0
  /** {@inheritDoc} */
  @Override
  @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
  public List<Job> getUsersJobs(final String username) {

    List<Job> jobs = null;
    User user = userDao.getUser(username);

    boolean administrator = false;

    if (AcegiUtil.containsRole(user.getAuthorities(), Roles.ADMIN.name())) {
      administrator = true;
    }

    if (administrator) {
      jobs = jobDao.getAllJobs();
    } else {
      jobs = jobDao.getAllUserJobs(username);
    }

    return jobs;
  }
Пример #2
0
 /** {@inheritDoc} */
 @Override
 @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
 public List<Job> getJobs() {
   return jobDao.getAllJobs();
 }