public boolean contains(ApplicationUser user) { for (final Object roleActor1 : roleActors) { RoleActor roleActor = (RoleActor) roleActor1; if (roleActor.contains(user)) { return true; } } return false; }
public boolean contains(final ApplicationUser user) { for (final RoleActor o : optimizedProjectRoleSet) { if (o.contains(user)) { return true; } } return false; }
private boolean roleActorsToRemoveContainsRoleActorFromProjectRole(RoleActor roleActorFromProjectRole, String actorType, ApplicationUser currentUser, Collection<String> actors, ProjectRole projectRole, Project project) { // We want to keep track of the amount of times we run into an existing role actor that contains the current // user within the users Set that the actor represents if (roleActorFromProjectRole.getType().equals(actorType) && roleActorFromProjectRole.contains(currentUser)) { for (String actorKey : actors) { // Create a roleActor object from the actorName and type so we can compare the equality of the // actor to be removed with the roleActorFromProjectRole RoleActor roleActorToRemove; try { roleActorToRemove = roleActorFactory.createRoleActor(null, projectRole.getId(), project.getId(), actorType, actorKey); } catch (RoleActorDoesNotExistException e) { throw new IllegalArgumentException("Unexpected error: the role actor '" + actorKey + "' of type '" + actorType + "' does not exist."); } // If the role to be removed is the same as the role we are looking at then we keep a count of // it since this is a role that is being removed and the role includes the current user. if (roleActorToRemove.equals(roleActorFromProjectRole)) { return true; } } } return false; }