final RunAsMetaData runAs = identity.getRunAs(); if (runAs != null) { final String role = runAs.getRoleName(); if (role != null && !role.trim().isEmpty()) { componentConfiguration.setRunAs(role.trim());
.setEnabled(servlet.isEnabled()); if (servlet.getRunAs() != null) { s.setRunAs(servlet.getRunAs().getRoleName());
public String getRunAsRoleName() { RunAsMetaData runAs = getDelegate().getRunAs(); if (runAs == null) return null; return runAs.getRoleName(); }
public String getRunAsRoleName() { RunAsMetaData runAs = getDelegate().getRunAs(); if (runAs == null) return null; return runAs.getRoleName(); }
/** * Access the RunAsIdentity associated with the given servlet * * @param servletName - the servlet-name from the web.xml * @return RunAsIdentity for the servet if one exists, null otherwise */ @Deprecated public RunAsIdentityMetaData getRunAsIdentity(String servletName) { RunAsIdentityMetaData identity = runAsIdentity.get(servletName); if (identity == null) { JBossServletsMetaData servlets = getServlets(); if (servlets != null) { ServletMetaData servlet = servlets.get(servletName); if (servlet != null) { // Check for a web.xml run-as only specification RunAsMetaData runAs = servlet.getRunAs(); if (runAs != null) { String roleName = runAs.getRoleName(); identity = new RunAsIdentityMetaData(roleName, null); runAsIdentity.put(servletName, identity); } } } } return identity; }
if (runAs != null) String roleName = runAs.getRoleName(); identity = new RunAsIdentityMetaData(roleName, null); runAsIdentity.put(servletName, identity);
/** * Access the RunAsIdentity associated with the given servlet * @param servletName - the servlet-name from the web.xml * @return RunAsIdentity for the servet if one exists, null otherwise */ @XmlTransient public RunAsIdentityMetaData getRunAsIdentity(String servletName) { RunAsIdentityMetaData identity = runAsIdentity.get(servletName); if (identity == null) { JBossServletsMetaData servlets = getServlets(); if(servlets != null) { ServletMetaData servlet = servlets.get(servletName); if (servlet != null) { // Check for a web.xml run-as only specification RunAsMetaData runAs = servlet.getRunAs(); if (runAs != null) { String roleName = runAs.getRoleName(); identity = new RunAsIdentityMetaData(roleName, null); runAsIdentity.put(servletName, identity); } } } } return identity; }
if (runAs != null) String roleName = runAs.getRoleName(); identity = new RunAsIdentityMetaData(roleName, null); runAsIdentity.put(servletName, identity);
if (runAs != null) String roleName = runAs.getRoleName(); identity = new RunAsIdentityMetaData(roleName, null); runAsIdentity.put(ejbName, identity);
if (runAs != null) String roleName = runAs.getRoleName(); identity = new RunAsIdentityMetaData(roleName, null); runAsIdentity.put(ejbName, identity);
@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); } } } }
webXmlRunAs = servlet.getRunAs().getRoleName(); if (principalName != null)
final RunAsMetaData runAs = identity.getRunAs(); if (runAs != null) { final String role = runAs.getRoleName(); if (role != null && !role.trim().isEmpty()) { componentConfiguration.setRunAs(role.trim());
private void addSecurityIdentityAnnotation(EJBContainer container, SecurityIdentityMetaData identity) { if (identity != null && !identity.isUseCallerId()) { RunAsMetaData runAs = identity.getRunAs(); RunAsImpl annotation = null; if (runAs != null) { annotation = new RunAsImpl(runAs.getRoleName()); addClassAnnotation(container, annotation.annotationType(), annotation); } String runAsPrincipal = identity.getRunAsPrincipal(); if (runAsPrincipal != null) { RunAsPrincipalImpl principalAnnotation = new RunAsPrincipalImpl(runAsPrincipal); addClassAnnotation(container, principalAnnotation .annotationType(), principalAnnotation); } } }
runAs.setRoleName(annotation.getRunAs().getRoleName()); servlet.setRunAs(runAs);
dest.setRunAs(webFragmentMetaData.getRunAs()); } else if (webFragmentMetaData.getRunAs() != null) { if (!resolveConflicts && dest.getRunAs().getRoleName() != null && !dest.getRunAs().getRoleName().equals(webFragmentMetaData.getRunAs().getRoleName())) { if (webMetaData == null || webMetaData.getRunAs() == null) { throw new IllegalStateException("Unresolved conflict on run as role name");
runAs.setRoleName(annotation.getRunAs().getRoleName()); servlet.setRunAs(runAs);
wrapper.setRunAs(annotation.getRunAs().getRoleName());
ejbXmlRunAs = si.getRunAs().getRoleName(); if (principalName != null)
ejbXmlRunAs = si.getRunAs().getRoleName(); if (principalName != null)