@Deprecated public void resolveRunAs() { // Update run-as indentity for a run-as-principal if (servlets != null) { for (JBossServletMetaData servlet : servlets) { String servletName = servlet.getServletName(); String principalName = servlet.getRunAsPrincipal(); // Get the web.xml run-as primary role String webXmlRunAs = null; if (servlet.getRunAs() != null) { webXmlRunAs = servlet.getRunAs().getRoleName(); } if (principalName != null) { // Update the run-as indentity to use the principal name if (webXmlRunAs == null) { // Needs to be merged from Annotations webXmlRunAs = "PLACEHOLDER_FOR_ANNOTATION"; // throw new IllegalStateException("run-as-principal: " // + principalName + // " found in jboss-web.xml but there was no run-as in web.xml"); } // See if there are any additional roles for this principal Set<String> extraRoles = securityRoles.getSecurityRoleNamesByPrincipal(principalName); RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, principalName, extraRoles); runAsIdentity.put(servletName, runAsId); } else if (webXmlRunAs != null) { RunAsIdentityMetaData runAsId = new RunAsIdentityMetaData(webXmlRunAs, null); runAsIdentity.put(servletName, runAsId); } } } }
if (annotation.getRunAs() != null && servlet.getRunAs() == null)
if (servlet.getServletClass() != null && servlet.getServletClass().equals(className)) { if (annotation.getRunAs() != null && servlet.getRunAs() == null) { RunAsMetaData runAs = new RunAsMetaData(); runAs.setRoleName(annotation.getRunAs().getRoleName());