public List<Long> roleActorOfTypeExistsForProjects(ApplicationUser currentUser, List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter, ErrorCollection errorCollection) { List<Long> projectsRoleActorExistsFor = new ArrayList<Long>(); boolean internalError = false; if (projectsToLimitBy == null || projectsToLimitBy.isEmpty()) { errorCollection.addErrorMessage(getText("project.roles.service.error.admin.projects.to.limit.needed")); internalError = true; } if (!hasAdminPermission(currentUser)) { addRequiredAdminPermissionErrorMessage(errorCollection); internalError = true; } if (!internalError) { projectsRoleActorExistsFor.addAll(projectRoleManager.roleActorOfTypeExistsForProjects(projectsToLimitBy, projectRole, projectRoleType, projectRoleParameter)); } return projectsRoleActorExistsFor; }