@Test public void testHasOneRoleOf() throws Exception { String[] roles = new String[] {"test/role3", "test/role2"}; assertTrue(user.hasOneRoleOf(roles)); roles = new String[] {"test/role3", "test/role4"}; assertFalse(user.hasOneRoleOf(roles)); }
public boolean hasOneRoleOf(String[] roles) { for (String r : roles) { if (hasRole(r)) { return true; } } return false; }
User implements Serializable { public boolean hasOneRoleOf(String[] roles) { for (String r : roles) { if (hasRole(r)) { return true; } } return false; } }
User implements Serializable { public boolean hasOneRoleOf(String[] roles) { for (String r : roles) { if (hasRole(r)) { return true; } } return false; } User(String name, String[] roles, String token);  User(String name, String[] roles, String token, boolean isWorkFlowAdmin); }
User implements Serializable { public boolean hasOneRoleOf(String[] roles) { for (String r : roles) { if (hasRole(r)) { return true; } } return false; } User(String name, String[] roles, String token);  User(String name, String[] roles, String token, boolean isWorkFlowAdmin); String getName(); String[] getRoles(); String getToken(); boolean hasRole(String role); boolean isWorkFlowAdmin(); boolean hasOneRoleOf(String[] roles); }
User implements Serializable { public boolean hasOneRoleOf(String[] roles) { for (String r : roles) { if (hasRole(r)) { return true; } } return false; } User(String name, String[] roles, String token);  User(String name, String[] roles, String token, boolean isWorkFlowAdmin); String getName(); String[] getRoles(); String getToken(); boolean hasRole(String role); boolean isWorkFlowAdmin(); boolean hasOneRoleOf(String[] roles);  }