@Test @WithMockUser(username = TEST_USER, roles = "BAM_MANAGER") @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void saveBamTest() throws IOException { final String path = registrationUtils.resolveFilePath(TEST_BAM_NAME); IndexedFileRegistrationRequest request = new IndexedFileRegistrationRequest(); request.setPath(path); request.setIndexPath(path + BAI_EXTENSION); request.setName(TEST_NSAME); request.setReferenceId(testReference.getId()); request.setType(BiologicalDataItemResourceType.FILE); BamFile bamFile = bamSecurityService.registerBam(request); Assert.assertNotNull(bamFile); final BamFile loadBamFile = bamFileManager.load(bamFile.getId()); Assert.assertNotNull(loadBamFile); Assert.assertTrue(bamFile.getId().equals(loadBamFile.getId())); Assert.assertTrue(bamFile.getName().equals(loadBamFile.getName())); Assert.assertTrue(bamFile.getCreatedDate().equals(loadBamFile.getCreatedDate())); Assert.assertTrue(bamFile.getReferenceId().equals(loadBamFile.getReferenceId())); Assert.assertTrue(bamFile.getPath().equals(loadBamFile.getPath())); Assert.assertTrue(bamFile.getIndex().getPath().equals(loadBamFile.getIndex().getPath())); Assert.assertTrue(bamFile.getOwner().equals(TEST_USER)); }
@PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) public BamFile registerBam(IndexedFileRegistrationRequest request) throws IOException { return bamManager.registerBam(request); }
BamSecurityService { @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) public BamFile registerBam(IndexedFileRegistrationRequest request) throws IOException { return bamManager.registerBam(request); } }
BamSecurityService { @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) public BamFile registerBam(IndexedFileRegistrationRequest request) throws IOException { return bamManager.registerBam(request); }  }
BamSecurityService { @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) public BamFile registerBam(IndexedFileRegistrationRequest request) throws IOException { return bamManager.registerBam(request); }  @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) BamFile registerBam(IndexedFileRegistrationRequest request); @PreAuthorize(ROLE_ADMIN + OR + READ_BAM_BY_QUERY_ID) Read loadRead(ReadQuery query, String fileUrl, String indexUrl); @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) BamFile unregisterBamFile(long bamFileId); @PreAuthorize(ROLE_ADMIN + OR + READ_BAM_BY_TRACK_ID) Track<Sequence> calculateConsensusSequence(Track<Sequence> track); @PreAuthorize(ROLE_ADMIN + OR + READ_BAM_BY_TRACK_ID) void sendBamTrackToEmitter(Track<Read> track, BamQueryOption option,
                                      ResponseBodyEmitter emitter); @PreAuthorize(ROLE_USER) void sendBamTrackToEmitterFromUrl(Track<Read> track, BamQueryOption option, String fileUrl, String indexUrl,
                                             ResponseBodyEmitter emitter); }
BamSecurityService { @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) public BamFile registerBam(IndexedFileRegistrationRequest request) throws IOException { return bamManager.registerBam(request); }  @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) BamFile registerBam(IndexedFileRegistrationRequest request); @PreAuthorize(ROLE_ADMIN + OR + READ_BAM_BY_QUERY_ID) Read loadRead(ReadQuery query, String fileUrl, String indexUrl); @PreAuthorize(ROLE_ADMIN + OR + ROLE_BAM_MANAGER) BamFile unregisterBamFile(long bamFileId); @PreAuthorize(ROLE_ADMIN + OR + READ_BAM_BY_TRACK_ID) Track<Sequence> calculateConsensusSequence(Track<Sequence> track); @PreAuthorize(ROLE_ADMIN + OR + READ_BAM_BY_TRACK_ID) void sendBamTrackToEmitter(Track<Read> track, BamQueryOption option,
                                      ResponseBodyEmitter emitter); @PreAuthorize(ROLE_USER) void sendBamTrackToEmitterFromUrl(Track<Read> track, BamQueryOption option, String fileUrl, String indexUrl,
                                             ResponseBodyEmitter emitter);  }