Package org.restlet.security
Class MethodAuthorizer
java.lang.Object
org.restlet.Restlet
org.restlet.routing.Filter
org.restlet.security.Authorizer
org.restlet.security.MethodAuthorizer
- All Implemented Interfaces:
Uniform
Authorizer based on authorized methods. Note that this authorizer makes the
difference between authenticated and anonymous users.
- Author:
- Jerome Louvel
-
Field Summary
Fields inherited from class org.restlet.security.Authorizer
ALWAYS, AUTHENTICATED, NEVER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAuthorizes the request only if its method is one of the authorized methods.Returns the modifiable list of methods authorized for anonymous users.Returns the modifiable list of methods authorized for authenticated users.voidsetAnonymousMethods(List<Method> anonymousMethods) Sets the modifiable list of methods authorized for anonymous users.voidsetAuthenticatedMethods(List<Method> authenticatedMethods) Sets the modifiable list of methods authorized for authenticated users.Methods inherited from class org.restlet.security.Authorizer
authorized, beforeHandle, getIdentifier, setIdentifier, unauthorizedMethods inherited from class org.restlet.routing.Filter
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stopMethods inherited from class org.restlet.Restlet
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
-
Constructor Details
-
MethodAuthorizer
public MethodAuthorizer()Default constructor. -
MethodAuthorizer
Constructor.- Parameters:
identifier- The identifier unique within an application.
-
-
Method Details
-
authorize
Authorizes the request only if its method is one of the authorized methods.- Specified by:
authorizein classAuthorizer- Parameters:
request- The request sent.response- The response to update.- Returns:
- True if the authorization succeeded.
-
getAnonymousMethods
Returns the modifiable list of methods authorized for anonymous users.- Returns:
- The modifiable list of methods authorized for anonymous users.
-
getAuthenticatedMethods
Returns the modifiable list of methods authorized for authenticated users.- Returns:
- The modifiable list of methods authorized for authenticated users.
-
setAnonymousMethods
Sets the modifiable list of methods authorized for anonymous users. This method clears the current list and adds all entries in the parameter list.- Parameters:
anonymousMethods- A list of methods authorized for anonymous users.
-
setAuthenticatedMethods
Sets the modifiable list of methods authorized for authenticated users. This method clears the current list and adds all entries in the parameter list.- Parameters:
authenticatedMethods- A list of methods authorized for authenticated users.
-