|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.Restlet
org.restlet.routing.Filter
org.restlet.security.Authorizer
org.restlet.security.MethodAuthorizer
public class MethodAuthorizer
Authorizer based on authorized methods. Note that this authorizer makes the difference between authenticated and anonymous users.
Field Summary |
---|
Fields inherited from class org.restlet.security.Authorizer |
---|
ALWAYS, AUTHENTICATED, NEVER |
Fields inherited from class org.restlet.routing.Filter |
---|
CONTINUE, SKIP, STOP |
Constructor Summary | |
---|---|
MethodAuthorizer()
Default constructor. |
|
MethodAuthorizer(String identifier)
Constructor. |
Method Summary | |
---|---|
boolean |
authorize(Request request,
Response response)
Authorizes the request only if its method is one of the authorized methods. |
List<Method> |
getAnonymousMethods()
Returns the modifiable list of methods authorized for anonymous users. |
List<Method> |
getAuthenticatedMethods()
Returns the modifiable list of methods authorized for authenticated users. |
void |
setAnonymousMethods(List<Method> anonymousMethods)
Sets the modifiable list of methods authorized for anonymous users. |
void |
setAuthenticatedMethods(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, unauthorized |
Methods inherited from class org.restlet.routing.Filter |
---|
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop |
Methods 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodAuthorizer()
public MethodAuthorizer(String identifier)
identifier
- The identifier unique within an application.Method Detail |
---|
public boolean authorize(Request request, Response response)
authorize
in class Authorizer
request
- The request sent.response
- The response to update.
public List<Method> getAnonymousMethods()
public List<Method> getAuthenticatedMethods()
public void setAnonymousMethods(List<Method> anonymousMethods)
anonymousMethods
- A list of methods authorized for anonymous users.public void setAuthenticatedMethods(List<Method> authenticatedMethods)
authenticatedMethods
- A list of methods authorized for authenticated users.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |