Link back and front all get #115

Merged
tonitch merged 40 commits from wal/front/listingUsers into master 2024-03-18 20:20:37 +01:00
Showing only changes of commit 77ac771b8f - Show all commits

View File

@ -125,7 +125,7 @@ public class UserController {
@DeleteMapping("/user/{id}")
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long id){
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token) || id.equals(authServ.getUserFromToken(token).getRegNo()))
return new UnauthorizedResponse<>(null);
User toDelete = userService.getUserById(id);