Compare commits

..

No commits in common. "4f002a29e16e09eec661d2557657199d7b217811" and "66d090d04503f290f349ba8fc2c44f657e9c9f1b" have entirely different histories.

View File

@ -124,7 +124,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) || id.equals(authServ.getUserFromToken(token).getRegNo()))
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
User toDelete = userService.getUserById(id);