/**
   * Fills a list with Privileges that reflect the input 'privileges' element. The 'privileges'
   * element has this format:
   *
   * <p><privileges> <group id="..."> <operation name="..."> ... </group> ... </privileges>
   *
   * <p>Operation names are: view, download, edit, etc... User defined operations are taken into
   * account.
   */
  private void addPrivileges(Element privil) throws BadInputEx {
    alPrivileges.clear();

    if (privil == null) return;

    for (Object o : privil.getChildren("group")) {
      Element group = (Element) o;
      String groupID = group.getAttributeValue("id");

      if (groupID == null) {
        throw new MissingParameterEx("attribute:id", group);
      }

      Privileges p = new Privileges(groupID);

      for (Object o1 : group.getChildren("operation")) {
        Element oper = (Element) o1;
        int op = getOperationId(oper);

        p.add(op);
      }

      alPrivileges.add(p);
    }
  }
  protected void copyTo(AbstractParams copy) {
    copy.name = name;
    copy.uuid = uuid;

    copy.useAccount = useAccount;
    copy.username = username;
    copy.password = password;

    copy.every = every;
    copy.oneRunOnly = oneRunOnly;

    copy.importXslt = importXslt;
    copy.validate = validate;

    for (Privileges p : alPrivileges) copy.alPrivileges.add(p.copy());

    for (String s : alCategories) copy.alCategories.add(s);

    copy.node = node;
  }