for (; esrr.hasMoreElements();){
SecurityRoleReference srr = (SecurityRoleReference)esrr.nextElement();
if(srr != null){
String action = srr.getRolename();
WebRoleRefPermission wrrp = new WebRoleRefPermission(name, action);
role.add(new Role(action));
pc.addToRole(srr.getSecurityRoleLink().getName(),wrrp);
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,"JACC: role-reference translation: RoleRefPermission created with name(servlet-name) = "+ name +
" and action(Role-name tag) = " + action + " added to role(role-link tag) = "+ srr.getSecurityRoleLink().getName());
}
}
}
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,"JACC: role-reference translation: Going through the list of roles not present in RoleRef elements and creating WebRoleRefPermissions ");
}
for(Iterator it = roleset.iterator(); it.hasNext();){
Role r = (Role)it.next();
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,"JACC: role-reference translation: Looking at Role = "+r.getName());
}
if(!role.contains(r)){
String action = r.getName();
WebRoleRefPermission wrrp = new WebRoleRefPermission(name, action);
pc.addToRole(action ,wrrp);
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,"JACC: role-reference translation: RoleRef = "+ action +
" is added for servlet-resource = " + name);
logger.log(Level.FINE, "JACC: role-reference translation: Permission added for above role-ref ="
+ wrrp.getName() +" "+ wrrp.getActions());
}
}
}
}
if(logger.isLoggable(Level.FINE)){
logger.exiting("WebPermissionUtil", "createWebRoleRefPermission");
}
// START S1AS8PE 4966609
/**
* For every security role in the web application add a
* WebRoleRefPermission to the corresponding role. The name of all such
* permissions shall be the empty string, and the actions of each
* permission shall be the corresponding role name. When checking a
* WebRoleRefPermission from a JSP not mapped to a servlet, use a
* permission with the empty string as its name
* and with the argument to isUserInRole as its actions
*/
for(Iterator it = roleset.iterator(); it.hasNext();){
Role r = (Role)it.next();
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,
"JACC: role-reference translation: Looking at Role = "
+ r.getName());
}
String action = r.getName();
WebRoleRefPermission wrrp = new WebRoleRefPermission("", action);
pc.addToRole(action ,wrrp);
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,
"JACC: role-reference translation: RoleRef = "
+ action
+ " is added for jsp's that can't be mapped to servlets");
logger.log(Level.FINE,
"JACC: role-reference translation: Permission added for above role-ref ="
+ wrrp.getName() +" "+ wrrp.getActions());
}
}
// END S1AS8PE 4966609