@Restrict("#{s:hasPermission(versionGroupMaintainerManageAction.group,'update')}")
  public void deleteMaintainer(HPerson person) {
    log.debug("try to delete maintainer {0} from slug {1}", person.getName(), this.slug);
    HIterationGroup iterationGroup = versionGroupServiceImpl.getBySlug(this.slug);
    Set<HPerson> personList = iterationGroup.getMaintainers();
    for (HPerson l : personList) {
      if (l.getEmail().equals(person.getEmail())) {
        log.debug("remove the person");
        iterationGroup.getMaintainers().remove(l);
        break;
      }
    }

    versionGroupServiceImpl.makePersistent(iterationGroup);
    versionGroupServiceImpl.flush();
  }
示例#2
0
 // TODO should we fire an event when username/name/email is changed (rare)?
 private void cacheUserDetails() {
   if (cachedUsername == null) {
     cachedUsername = getCredentials().getUsername();
   }
   if (cachedPersonName == null) {
     HAccount account = accountDAO.getByUsername(cachedUsername);
     if (account != null) {
       HPerson person = account.getPerson();
       if (person != null) {
         cachedPersonName = person.getName();
         cachedPersonEmail = person.getEmail();
       } else {
         cachedPersonEmail = null;
       }
     } else {
       cachedPersonEmail = null;
     }
   }
 }