1
0
forked from PGL/Clyde

cleaned the services

This commit is contained in:
2024-03-16 20:25:35 +01:00
parent 97b57b361d
commit 382d3c203a
16 changed files with 67 additions and 87 deletions

View File

@ -41,7 +41,7 @@ public class UserController {
@PostMapping("/user")
public ResponseEntity<Map<String ,Object>> postUser(@RequestBody User user,@RequestHeader("Authorization") String token){
if (authServ.IsNotIn(new Role[]{Role.Admin,Role.InscriptionService,Role.Secretary},token))
if (authServ.isNotIn(new Role[]{Role.Admin,Role.InscriptionService,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
return new ResponseEntity<>(userWithoutPassword(userService.save(user)),HttpStatus.CREATED);
@ -50,7 +50,7 @@ public class UserController {
@GetMapping("/users")
public ResponseEntity<Iterable<HashMap<String,Object>>> getAllUsers(@RequestHeader("Authorization") String token){
if (authServ.IsNotIn(new Role[]{Role.Admin,Role.Secretary},token))
if (authServ.isNotIn(new Role[]{Role.Admin,Role.Secretary},token))
return new UnauthorizedResponse<>(null);
Iterable<User> users = userService.getAll();