Compare commits
No commits in common. "4f002a29e16e09eec661d2557657199d7b217811" and "66d090d04503f290f349ba8fc2c44f657e9c9f1b" have entirely different histories.
4f002a29e1
...
66d090d045
@ -124,7 +124,7 @@ public class UserController {
|
|||||||
|
|
||||||
@DeleteMapping("/user/{id}")
|
@DeleteMapping("/user/{id}")
|
||||||
public ResponseEntity<String> deleteStudent(@RequestHeader("Authorization") String token, @PathVariable Long 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);
|
return new UnauthorizedResponse<>(null);
|
||||||
|
|
||||||
User toDelete = userService.getUserById(id);
|
User toDelete = userService.getUserById(id);
|
||||||
|
Loading…
Reference in New Issue
Block a user