public class MethodAuthorizer extends Authorizer
ALWAYS, AUTHENTICATED, NEVER
Constructor and Description |
---|
MethodAuthorizer()
Default constructor.
|
MethodAuthorizer(java.lang.String identifier)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
authorize(Request request,
Response response)
Authorizes the request only if its method is one of the authorized
methods.
|
java.util.List<Method> |
getAnonymousMethods()
Returns the modifiable list of methods authorized for anonymous users.
|
java.util.List<Method> |
getAuthenticatedMethods()
Returns the modifiable list of methods authorized for authenticated
users.
|
void |
setAnonymousMethods(java.util.List<Method> anonymousMethods)
Sets the modifiable list of methods authorized for anonymous users.
|
void |
setAuthenticatedMethods(java.util.List<Method> authenticatedMethods)
Sets the modifiable list of methods authorized for authenticated users.
|
authorized, beforeHandle, getIdentifier, setIdentifier, unauthorized
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public MethodAuthorizer()
public MethodAuthorizer(java.lang.String identifier)
identifier
- The identifier unique within an application.public boolean authorize(Request request, Response response)
authorize
in class Authorizer
request
- The request sent.response
- The response to update.public java.util.List<Method> getAnonymousMethods()
public java.util.List<Method> getAuthenticatedMethods()
public void setAnonymousMethods(java.util.List<Method> anonymousMethods)
anonymousMethods
- A list of methods authorized for anonymous users.public void setAuthenticatedMethods(java.util.List<Method> authenticatedMethods)
authenticatedMethods
- A list of methods authorized for authenticated users.Copyright © 2005-2024 Restlet.