Commit 40c4399d authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

fixed transactional issue in FileController

parent e1e2b978
Pipeline #11777 failed with stage
in 12 minutes and 28 seconds
......@@ -40,7 +40,7 @@ public class FileController extends BaseController {
return fileRest.getFile(id);
}
@PreAuthorize("@uploadedFileEntryDao.getById(#id).owner?.login == authentication.name")
@PreAuthorize("@fileService.getById(#id)?.owner?.login == authentication.name")
@PostMapping(value = "/{id}:uploadContent")
public Map<String, Object> uploadContent(@PathVariable(value = "id") String id, @RequestBody byte[] data)
throws ObjectNotFoundException {
......
package lcsb.mapviewer.services.impl;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
import lcsb.mapviewer.persist.dao.cache.UploadedFileEntryDao;
import lcsb.mapviewer.services.interfaces.IFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service
public class FileService implements IFileService {
private UploadedFileEntryDao uploadedFileEntryDao;
@Autowired
public FileService(UploadedFileEntryDao uploadedFileEntryDao) {
this.uploadedFileEntryDao = uploadedFileEntryDao;
}
@Override
public UploadedFileEntry getById(int id) {
return uploadedFileEntryDao.getById(id);
}
}
package lcsb.mapviewer.services.interfaces;
import lcsb.mapviewer.model.cache.UploadedFileEntry;
public interface IFileService {
UploadedFileEntry getById(int id);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment