permCollection.put(key.roleName, p);
}
p.add(srp);
pc.addToRole(key.roleName,
new SipRoleRefPermission(key.servletName, key.roleName));
}
Iterator<String> permItr = permCollection.keySet().iterator();
while (permItr.hasNext()) {
String role = permItr.next();
Permissions perms = (Permissions) permCollection.get(role);
pc.addToRole(role, perms);
}
Map<String, Servlet> servlets = sipConfig.getServlets();
Iterator<Servlet> servletItr = servlets.values().iterator();
while (servletItr.hasNext()) {
Servlet servlet = servletItr.next();
String servletName = servlet.getServletName();
Enumeration<RoleReference> srRef = servlet.getSecurityRoleReferences();
if (srRef != null) {
// Iterator<SecurityRoleReference> srItr = srRef.iterator();
while (srRef.hasMoreElements()) {
RoleReference srr = srRef.nextElement();
String roleLink = srr.getSecurityRoleLink().getName();
String roleName = srr.getRolename();
SipRoleRefPermission srp = new SipRoleRefPermission(servletName,
roleName);
pc.addToRole(roleLink, srp);
}
}
}