Package com.example.helloworld.auth
Class ExampleAuthorizer
- java.lang.Object
-
- com.example.helloworld.auth.ExampleAuthorizer
-
- All Implemented Interfaces:
Authorizer<User>
public class ExampleAuthorizer extends Object implements Authorizer<User>
-
-
Constructor Summary
Constructors Constructor Description ExampleAuthorizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
authorize(User user, String role, @Nullable jakarta.ws.rs.container.ContainerRequestContext ctx)
Decides if access is granted for the given principal in the given role.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.dropwizard.auth.Authorizer
getAuthorizationContext
-
-
-
-
Method Detail
-
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 interfaceAuthorizer<User>
- Parameters:
user
- aPrincipal
object, representing a userrole
- a user rolectx
- a request context.- Returns:
true
, if the access is granted,false otherwise
-
-