Class HasRoleFilter

All Implemented Interfaces:
jakarta.ws.rs.container.ContainerRequestFilter

@Priority(2000) public class HasRoleFilter extends AbstractAuthorizationFilter
Ensures the user has a given role.

When the user is not authorized, the default implementation will return a 403 Forbidden error when the user is authenticated but is missing the required role, and defers to the parent behavior otherwise.

An instance of this class needs to be registered through a DynamicFeature, or a subclass needs to be created to be able to create and use a name binding.