Map actionAggregation = ((SecurityImpl)nsaToken.getSecurityHelper()).getActionAggregation();
Set rootSet = new HashSet(actionAggregation.keySet());
Map work = new HashMap();
Iterator actions = actionAggregation.keySet().iterator();
while (actions.hasNext()) {
ActionNode a = (ActionNode)actions.next();
Element sp = new Element(E_SUPPORTED_PRIVILEGE, DNSP);
Element p = new Element(E_PRIVILEGE, DNSP);
p.addContent(new Element(a.getPath().lastSegment(), DNSP));
sp.addContent(p);
work.put(a, sp);
}
actions = actionAggregation.keySet().iterator();
while (actions.hasNext()) {
ActionNode a = (ActionNode)actions.next();
Iterator aggregates = ((Set)actionAggregation.get(a)).iterator();
while (aggregates.hasNext()) {
ActionNode c = (ActionNode)aggregates.next();
((Element)work.get(a)).addContent((Element)work.get(c));
rootSet.remove(c);
}
}
Element rootSp = new Element(E_SUPPORTED_PRIVILEGE, DNSP);