Class ExampleAuthorizer

java.lang.Object
com.example.helloworld.auth.ExampleAuthorizer
All Implemented Interfaces:
Authorizer<User>

public class ExampleAuthorizer extends Object implements Authorizer<User>
  • Constructor Details

    • ExampleAuthorizer

      public ExampleAuthorizer()
  • Method Details

    • authorize

      public boolean authorize(User user, String role, @Nullable jakarta.ws.rs.container.ContainerRequestContext ctx)
      Description copied from interface: Authorizer
      Decides if access is granted for the given principal in the given role.
      Specified by:
      authorize in interface Authorizer<User>
      Parameters:
      user - a Principal object, representing a user
      role - a user role
      ctx - a request context.
      Returns:
      true, if the access is granted, false otherwise