Class ProtectedClassResource

java.lang.Object
com.example.helloworld.resources.ProtectedClassResource

@Path("/protected") @RolesAllowed("BASIC_GUY") public final class ProtectedClassResource extends Object
RolesAllowed, PermitAll are supported on the class level.

Method level annotations take precedence over the class level ones

  • Constructor Details

    • ProtectedClassResource

      public ProtectedClassResource()
  • Method Details

    • showSecret

      @GET @PermitAll @Path("guest") public String showSecret(User user)
    • showBasicUserSecret

      @GET public String showBasicUserSecret(@Context jakarta.ws.rs.core.SecurityContext context)
    • showAdminSecret

      @GET @RolesAllowed("ADMIN") @Path("admin") public String showAdminSecret(User user)