String servletName = servletInfo.getName(); String roleName = role; List<SecurityRoleRef> roleRefs = servletInfo.getSecurityRoleRefs(); if (roleRefs != null) { for (SecurityRoleRef ref : roleRefs) {
public boolean isUserInRole(String role) { final Map<String, Set<String>> principalVersusRolesMap = deployment.getDeploymentInfo().getPrincipalVersusRolesMap(); final Set<String> roles = principalVersusRolesMap.get(account.getPrincipal().getName()); for (SecurityRoleRef ref : servletInfo.getSecurityRoleRefs()) { if (ref.getRole().equals(role)) { if (roles != null && roles.contains(ref.getLinkedRole())) { return true; } return account.getRoles().contains(ref.getLinkedRole()); } } if (roles != null && roles.contains(role)) { return true; } return account.getRoles().contains(role); }
public boolean isUserInRole(String role) { final Map<String, Set<String>> principalVersusRolesMap = deployment.getDeploymentInfo().getPrincipalVersusRolesMap(); final Set<String> roles = principalVersusRolesMap.get(account.getPrincipal().getName()); for (SecurityRoleRef ref : servletInfo.getSecurityRoleRefs()) { if (ref.getRole().equals(role)) { if (roles != null && roles.contains(ref.getLinkedRole())) { return true; } return account.getRoles().contains(ref.getLinkedRole()); } } if (roles != null && roles.contains(role)) { return true; } return account.getRoles().contains(role); }
@Override public boolean isUserInRole(String role, Account account, ServletInfo servletInfo, HttpServletRequest request, Deployment deployment) { final Map<String, Set<String>> principalVersusRolesMap = deployment.getDeploymentInfo().getPrincipalVersusRolesMap(); final Set<String> roles = principalVersusRolesMap.get(account.getPrincipal().getName()); //TODO: a more efficient imple for (SecurityRoleRef ref : servletInfo.getSecurityRoleRefs()) { if (ref.getRole().equals(role)) { if (roles != null && roles.contains(ref.getLinkedRole())) { return true; } return account.getRoles().contains(ref.getLinkedRole()); } } if (roles != null && roles.contains(role)) { return true; } return account.getRoles().contains(role); }
String servletName = servletInfo.getName(); String roleName = role; List<SecurityRoleRef> roleRefs = servletInfo.getSecurityRoleRefs(); if (roleRefs != null) { for (SecurityRoleRef ref : roleRefs) {
String servletName = servletInfo.getName(); String roleName = role; List<SecurityRoleRef> roleRefs = servletInfo.getSecurityRoleRefs(); if (roleRefs != null) { for (SecurityRoleRef ref : roleRefs) {