<commit_before>package org.innovateuk.ifs.horizon.transactional;

import org.innovateuk.ifs.commons.service.ServiceResult;
import org.innovateuk.ifs.horizon.resource.ApplicationHorizonWorkProgrammeResource;
import org.innovateuk.ifs.horizon.resource.HorizonWorkProgramme;

import java.util.List;

public interface HorizonWorkProgrammeService {

    ServiceResult<Void> updateWorkProgrammesForApplication(List<HorizonWorkProgramme> programmes, long applicationId);

    ServiceResult<List<ApplicationHorizonWorkProgrammeResource>> findSelectedForApplication(long applicationId);
}
<commit_msg>IFS-11366 - Has permission added to service method.<commit_after>package org.innovateuk.ifs.horizon.transactional;

import org.innovateuk.ifs.commons.service.ServiceResult;
import org.innovateuk.ifs.horizon.resource.ApplicationHorizonWorkProgrammeResource;
import org.innovateuk.ifs.horizon.resource.HorizonWorkProgramme;
import org.springframework.security.access.prepost.PreAuthorize;

import java.util.List;

public interface HorizonWorkProgrammeService {

    @PreAuthorize("hasPermission(#applicationId, 'org.innovateuk.ifs.application.resource.ApplicationResource', 'UPDATE')")
    ServiceResult<Void> updateWorkProgrammesForApplication(List<HorizonWorkProgramme> programmes, long applicationId);

    ServiceResult<List<ApplicationHorizonWorkProgrammeResource>> findSelectedForApplication(long applicationId);
}

{'fraction_non_alphanumeric': 0.08504606661941885, 'fraction_numerical': 0.003543586109142452, 'mean_word_length': 8.805555555555555, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6547253', 'n_tokens_mistral': 401, 'n_tokens_neox': 390, 'n_words': 53}