Ejemplo n.º 1
0
  /**
   * @return SUCCESS.
   * @throws CSException is unable to change owner.
   */
  public String reassign() throws CSException {
    if (owner == null) {
      addActionError("Select a new Owner");
      users = ServiceLocatorFactory.getPermissionsManagementService().getUsers(targetUser);
      users.remove(targetUser);
      return "newOwner";
    }

    for (long gId : groupIds) {
      ServiceLocatorFactory.getPermissionsManagementService()
          .changeOwner(gId, owner.getLoginName());
      ActionHelper.saveMessage(
          "Collaboration Group " + gId + " assigned to " + owner.getLoginName());
    }
    for (long pId : projectIds) {
      ServiceLocatorFactory.getProjectManagementService().changeOwner(pId, owner.getLoginName());
      ActionHelper.saveMessage("Experiment " + pId + " assigned to " + owner.getLoginName());
    }

    return "listOwners";
  }
Ejemplo n.º 2
0
  /** @return SUCCESS. */
  public String assets() {
    if (owner == null) {
      ActionHelper.saveMessage("Select a user");
      return "listOwners";
    }
    long id = owner.getUserId().longValue();
    groups =
        ServiceLocatorFactory.getPermissionsManagementService().getCollaboratorGroupsForOwner(id);
    projects = ServiceLocatorFactory.getProjectManagementService().getProjectsForOwner(owner);

    return SUCCESS;
  }