private Set<String> mapRoles(Caller caller, Set<String> currentRoles, Set<String> runAsRoles, boolean sanitized) { Set<String> result = currentRoles; if (runAsRoles != null) { Set<String> roleSet = new HashSet<String>(); for (String role : runAsRoles) { String requestedRole = sanitized ? role : getRoleFromText(role); if (realRoleMapper.canRunAs(currentRoles, requestedRole)) { roleSet.add(requestedRole); } } if (roleSet.isEmpty() == false) { result = Collections.unmodifiableSet(roleSet); if (ACCESS_LOGGER.isTraceEnabled()) { StringBuilder sb = new StringBuilder("User '").append(caller.getName()).append( "' Mapped to requested roles { "); for (String current : result) { sb.append("'").append(current).append("' "); } sb.append("}"); ACCESS_LOGGER.trace(sb.toString()); } } } return result; }
private Set<String> mapRoles(Caller caller, Set<String> currentRoles, Set<String> runAsRoles, boolean sanitized) { Set<String> result = currentRoles; if (runAsRoles != null) { Set<String> roleSet = new HashSet<String>(); for (String role : runAsRoles) { String requestedRole = sanitized ? role : getRoleFromText(role); if (realRoleMapper.canRunAs(currentRoles, requestedRole)) { roleSet.add(requestedRole); } } if (roleSet.isEmpty() == false) { result = Collections.unmodifiableSet(roleSet); if (ACCESS_LOGGER.isTraceEnabled()) { StringBuilder sb = new StringBuilder("User '").append(caller.getName()).append( "' Mapped to requested roles { "); for (String current : result) { sb.append("'").append(current).append("' "); } sb.append("}"); ACCESS_LOGGER.trace(sb.toString()); } } } return result; }
private Set<String> mapRoles(Caller caller, Set<String> currentRoles, Set<String> runAsRoles, boolean sanitized) { Set<String> result = currentRoles; if (runAsRoles != null) { Set<String> roleSet = new HashSet<String>(); for (String role : runAsRoles) { String requestedRole = sanitized ? role : getRoleFromText(role); if (realRoleMapper.canRunAs(currentRoles, requestedRole)) { roleSet.add(requestedRole); } } if (roleSet.isEmpty() == false) { result = Collections.unmodifiableSet(roleSet); if (ACCESS_LOGGER.isTraceEnabled()) { StringBuilder sb = new StringBuilder("User '").append(caller.getName()).append( "' Mapped to requested roles { "); for (String current : result) { sb.append("'").append(current).append("' "); } sb.append("}"); ACCESS_LOGGER.trace(sb.toString()); } } } return result; }