|
23 | 23 | private final @NotNull UserService userService; |
24 | 24 | private final @NotNull FileService fileService; |
25 | 25 |
|
26 | | - @PreAuthorize("isAuthenticated()") @PostMapping("/{id}/modify/tags") public HttpStatus modifyTags( |
| 26 | + @PreAuthorize("@verificationService.isFullyAuthenticated()") @PostMapping("/{id}/modify/tags") public HttpStatus modifyTags( |
27 | 27 | @AuthenticationPrincipal Long userId, @PathVariable Long id, @NotNull @RequestBody Set<String> newTags) |
28 | 28 | { |
29 | 29 | FileEntity fileEntity = fileService.getRepository().getReferenceById(id); |
|
35 | 35 | return HttpStatus.UNAUTHORIZED; |
36 | 36 | } |
37 | 37 |
|
38 | | - @PreAuthorize("isAuthenticated()") @GetMapping("/get/info/{fileId}") public ResponseEntity<FileModel> getFileInfoById( |
| 38 | + @PreAuthorize("@verificationService.isFullyAuthenticated()") @GetMapping("/get/info/{fileId}") public ResponseEntity<FileModel> getFileInfoById( |
39 | 39 | @AuthenticationPrincipal Long userId, @PathVariable Long fileId) |
40 | 40 | { |
41 | 41 | Function<FileEntity, Boolean> access = file -> |
|
51 | 51 | return new ResponseEntity<>(HttpStatus.UNAUTHORIZED); |
52 | 52 | } |
53 | 53 |
|
54 | | - @PreAuthorize("isAuthenticated()") @GetMapping("/get/{fileId}") public ResponseEntity<ByteArrayResource> downloadFileWithID( |
| 54 | + @PreAuthorize("@verificationService.isFullyAuthenticated()") @GetMapping("/get/{fileId}") public ResponseEntity<ByteArrayResource> downloadFileWithID( |
55 | 55 | @AuthenticationPrincipal Long userId, @PathVariable Long fileId) throws IOException |
56 | 56 | { |
57 | 57 | Function<FileEntity, Boolean> access = file -> file.hasAccess(userService.loadEntityByIDSafe(userId)); |
|
62 | 62 | throw new ResponseStatusException(HttpStatus.UNAUTHORIZED); |
63 | 63 | } |
64 | 64 |
|
65 | | - @PreAuthorize("isAuthenticated()") @GetMapping("/get/{fileId}/{index}") public ResponseEntity<ByteArrayResource> downloadFileIndexWithID( |
| 65 | + @PreAuthorize("@verificationService.isFullyAuthenticated()") @GetMapping("/get/{fileId}/{index}") public ResponseEntity<ByteArrayResource> downloadFileIndexWithID( |
66 | 66 | @AuthenticationPrincipal Long userId, @PathVariable Long fileId, @PathVariable Integer index) throws IOException |
67 | 67 | { |
68 | 68 | Function<FileEntity, Boolean> access = file -> file.hasAccess(userService.loadEntityByIDSafe(userId)); |
|
73 | 73 | throw new ResponseStatusException(HttpStatus.UNAUTHORIZED); |
74 | 74 | } |
75 | 75 |
|
76 | | - @PreAuthorize("isAuthenticated()") @GetMapping("/get/{fileId}/files") public ResponseEntity<List<FileInfoModel>> getSingleFiles( |
| 76 | + @PreAuthorize("@verificationService.isFullyAuthenticated()") @GetMapping("/get/{fileId}/files") public ResponseEntity<List<FileInfoModel>> getSingleFiles( |
77 | 77 | @AuthenticationPrincipal Long userId, @PathVariable Long fileId) |
78 | 78 | { |
79 | 79 | Function<FileEntity, Boolean> access = file -> file.hasAccess(userService.loadEntityByIDSafe(userId)); |
|
0 commit comments