fix(项目设置): 文件重新上传接口增加权限校验

文件重新上传接口增加权限校验
This commit is contained in:
song-tianyang 2023-06-19 19:53:14 +08:00 committed by 建国
parent 02d06a74ff
commit 8b2e5e73ad
1 changed files with 2 additions and 0 deletions

View File

@ -117,12 +117,14 @@ public class ProjectController {
}
@PostMapping(value = "upload/files/{projectId}", consumes = {"multipart/form-data"})
@RequiresPermissions(value = {"PROJECT_FILE:READ+UPLOAD+JAR", "PROJECT_FILE:READ+UPLOAD+FILE"}, logical = Logical.OR)
@MsAuditLog(module = OperLogModule.PROJECT_FILE_MANAGEMENT, type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#projectId)", msClass = ProjectService.class)
public List<FileMetadata> uploadFiles(@PathVariable String projectId, @RequestPart(value = "file", required = false) List<MultipartFile> files) {
return projectService.uploadFiles(projectId, files);
}
@PostMapping(value = "/update/file/{fileId}", consumes = {"multipart/form-data"})
@RequiresPermissions(value = {"PROJECT_FILE:READ+UPLOAD+JAR", "PROJECT_FILE:READ+UPLOAD+FILE"}, logical = Logical.OR)
@MsAuditLog(module = OperLogModule.PROJECT_FILE_MANAGEMENT, type = OperLogConstants.IMPORT, content = "#msClass.getLogDetails(#fileId)", msClass = ProjectService.class)
public FileMetadata updateFile(@PathVariable String fileId, @RequestPart(value = "file", required = false) MultipartFile file) {
return projectService.updateFile(fileId, file);