We are currently evaluating Spring-Boot as a framework for a project. There are security-requirements to this project, basically we want to limit webservice calls to certain roles, but at the same time, results of said calls are dependent on the roles, a user is in.
Example: I do understand, I can prevent or allow a user access to a certain REST call by using
@PreAuthorize("...")
@PostAuthorize("...")
but what I need is something more along the lines of this code (which is from DropWizard):
@Path("/for_date_sec/{date}")
@GET
@RolesAllowed("ADMIN")
public void doSecured(@Auth User user, @PathParam(value = "date") String date) {
selectReadableObjects(user.getRoles());
...
}
From what I understand, the '@PreAuthorize/@PostAuthorize' annotations have access to the principal. Can we also expose it to the Is this possible?