cleaned the services
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user