|
||||||||||
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.RoleAuthorizer
public class RoleAuthorizer
Authorizer based on authorized and forbidden roles. Note that if no role is added to the "authorizedRoles" list, then only the "forbiddenRoles" list is considered.
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 | |
---|---|
RoleAuthorizer()
Default constructor. |
|
RoleAuthorizer(String identifier)
Constructor. |
Method Summary | |
---|---|
boolean |
authorize(Request request,
Response response)
Authorizes the request only if its subject is in one of the authorized roles and in none of the forbidden ones. |
List<Role> |
getAuthorizedRoles()
Returns the modifiable list of authorized roles. |
List<Role> |
getForbiddenRoles()
Returns the modifiable list of forbidden roles. |
void |
setAuthorizedRoles(List<Role> authorizedRoles)
Sets the modifiable list of authorized roles. |
void |
setForbiddenRoles(List<Role> forbiddenRoles)
Sets the modifiable list of forbidden roles. |
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 RoleAuthorizer()
public RoleAuthorizer(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<Role> getAuthorizedRoles()
public List<Role> getForbiddenRoles()
public void setAuthorizedRoles(List<Role> authorizedRoles)
authorizedRoles
- A list of authorized roles.public void setForbiddenRoles(List<Role> forbiddenRoles)
forbiddenRoles
- A list of forbidden roles.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |