return true; if (userConstraint.equals(TransportGuarantee.NONE.name())) { if (log.isDebugEnabled()) log.debug(" User data constraint has no restrictions");
return true; if (userConstraint.equals(TransportGuarantee.NONE.name())) { if (log.isDebugEnabled()) log.debug(" User data constraint has no restrictions");
private SecurityConstraintInfo newSecurityConstraint(String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic, boolean force) { //IF emptyRoleSemantic=PERMIT AND rolesAllowed={} AND transportGuarantee=NONE then // No Constraint //END IF if (force || rolesAllowed.length > 0 || transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL) || emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.DENY)) { SecurityConstraintInfo securityConstraint = new SecurityConstraintInfo(); WebResourceCollectionInfo webResourceCollection = new WebResourceCollectionInfo(); securityConstraint.webResourceCollections.add(webResourceCollection); if (transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL)) { securityConstraint.userDataConstraint = TransportGuarantee.CONFIDENTIAL.name(); } if (emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.DENY)) { securityConstraint.authConstraint = new AuthConstraintInfo(); } else if (rolesAllowed.length > 0) { //When rolesAllowed.length == 0 and emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.PERMIT), no need to create the AuthConstraint object, as it means deny all AuthConstraintInfo authConstraint = new AuthConstraintInfo(); for (String roleAllowed : rolesAllowed) { authConstraint.roleNames.add(roleAllowed); } securityConstraint.authConstraint = authConstraint; } return securityConstraint; } return null; }
constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true;
constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true;
constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true;
constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true;
private static SecurityConstraint createConstraint( HttpConstraintElement element, String urlPattern, boolean alwaysCreate) { SecurityConstraint constraint = new SecurityConstraint(); SecurityCollection collection = new SecurityCollection(); boolean create = alwaysCreate; if (element.getTransportGuarantee() != ServletSecurity.TransportGuarantee.NONE) { constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true; } if (element.getRolesAllowed().length > 0) { String[] roles = element.getRolesAllowed(); for (String role : roles) { constraint.addAuthRole(role); } create = true; } if (element.getEmptyRoleSemantic() != EmptyRoleSemantic.PERMIT) { constraint.setAuthConstraint(true); create = true; } if (create) { collection.addPattern(urlPattern); constraint.addCollection(collection); return constraint; } return null; }
private static SecurityConstraint createConstraint( HttpConstraintElement element, String urlPattern, boolean alwaysCreate) { SecurityConstraint constraint = new SecurityConstraint(); SecurityCollection collection = new SecurityCollection(); boolean create = alwaysCreate; if (element.getTransportGuarantee() != ServletSecurity.TransportGuarantee.NONE) { constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true; } if (element.getRolesAllowed().length > 0) { String[] roles = element.getRolesAllowed(); for (String role : roles) { constraint.addAuthRole(role); } create = true; } if (element.getEmptyRoleSemantic() != EmptyRoleSemantic.PERMIT) { constraint.setAuthConstraint(true); create = true; } if (create) { collection.addPattern(urlPattern); constraint.addCollection(collection); return constraint; } return null; }
private static SecurityConstraint createConstraint( HttpConstraintElement element, String urlPattern, boolean alwaysCreate) { SecurityConstraint constraint = new SecurityConstraint(); SecurityCollection collection = new SecurityCollection(); boolean create = alwaysCreate; if (element.getTransportGuarantee() != ServletSecurity.TransportGuarantee.NONE) { constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true; } if (element.getRolesAllowed().length > 0) { String[] roles = element.getRolesAllowed(); for (String role : roles) { constraint.addAuthRole(role); } create = true; } if (element.getEmptyRoleSemantic() != EmptyRoleSemantic.PERMIT) { constraint.setAuthConstraint(true); create = true; } if (create) { collection.addPattern(urlPattern); constraint.addCollection(collection); return constraint; } return null; }
constraint.setUserConstraint(element.getTransportGuarantee().name()); create = true;