public class RoleAuthorizer extends Authorizer
ALWAYS, AUTHENTICATED, NEVER| Constructor and Description |
|---|
RoleAuthorizer()
Default constructor.
|
RoleAuthorizer(java.lang.String identifier)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.util.List<Role> |
getAuthorizedRoles()
Returns the modifiable list of authorized roles.
|
java.util.List<Role> |
getForbiddenRoles()
Returns the modifiable list of forbidden roles.
|
void |
setAuthorizedRoles(java.util.List<Role> authorizedRoles)
Sets the modifiable list of authorized roles.
|
void |
setForbiddenRoles(java.util.List<Role> forbiddenRoles)
Sets the modifiable list of forbidden roles.
|
authorized, beforeHandle, getIdentifier, setIdentifier, unauthorizedafterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stopcreateFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwnerpublic RoleAuthorizer()
public RoleAuthorizer(java.lang.String identifier)
identifier - The identifier unique within an application.public boolean authorize(Request request, Response response)
authorize in class Authorizerrequest - The request sent.response - The response to update.public java.util.List<Role> getAuthorizedRoles()
public java.util.List<Role> getForbiddenRoles()
public void setAuthorizedRoles(java.util.List<Role> authorizedRoles)
authorizedRoles - A list of authorized roles.public void setForbiddenRoles(java.util.List<Role> forbiddenRoles)
forbiddenRoles - A list of forbidden roles.Copyright © 2005-2024 Restlet.