/** * Get the security roles by principal * * @param userName the principal name * @return the security roles containing the principal or null for no roles * @throws IllegalArgumentException for a null user name */ @Deprecated public SecurityRolesMetaData getSecurityRolesByPrincipal(String userName) { if (userName == null) throw new IllegalArgumentException("Null userName"); if (isEmpty()) return null; SecurityRolesMetaData result = new SecurityRolesMetaData(); for (SecurityRoleMetaData role : this) { if (role.hasPrincipal(userName)) result.add(role); } return result; }
/** * Get the security roles by principal * * @param userName the principal name * @return the security roles containing the principal or null for no roles * @throws IllegalArgumentException for a null user name */ @Deprecated public SecurityRolesMetaData getSecurityRolesByPrincipal(String userName) { if (userName == null) throw new IllegalArgumentException("Null userName"); if (isEmpty()) return null; SecurityRolesMetaData result = new SecurityRolesMetaData(); for (SecurityRoleMetaData role : this) { if (role.hasPrincipal(userName)) result.add(role); } return result; }