org.restlet.ext.jaxrs
Interface RoleChecker


Deprecated. Use the new Restlet security model instead.

@Deprecated
public interface RoleChecker

This interface provides user role checks.

This interface is from a time when Restlet did not have a full security API, and hence no support for checking if a user is in a role. At that time, this interface was used to check if a user is in a role. It is currently still supported for backwards compatibility, but should not be used for new development.

Implementations must be thread save.

This interface is used by SecurityContext.isUserInRole(String). The JAX-RS runtime delegates this method call along with the Principal of the HTTP request to method isInRole(Principal, String), the only method of this interface.

If you want to use a RoleChecker, you must give an instance of this inteface to the JaxRsApplication. If you do not give an instance, the normal Restlet security API will be used.

To check if the user is authenticated, use any Restlet Guard.

Author:
Stephan Koops
See Also:
SecurityContext, ClientInfo.getRoles()

Field Summary
static RoleChecker ALLOW_ALL
          Deprecated. Access control constant that gives all roles to all principals.
static RoleChecker FORBID_ALL
          Deprecated. Access control constant that doesn't give any role to any principal.
static RoleChecker REJECT_WITH_ERROR
          Deprecated. An RoleChecker that throws an WebApplicationExeption with status 500 (Internal Server Error) for every call on it.
 
Method Summary
 boolean isInRole(Principal principal, String role)
          Deprecated. Checks, if the user is in the given role, or false if not.
This method is used by the SecurityContext.
 

Field Detail

ALLOW_ALL

static final RoleChecker ALLOW_ALL
Deprecated. 
Access control constant that gives all roles to all principals.


FORBID_ALL

static final RoleChecker FORBID_ALL
Deprecated. 
Access control constant that doesn't give any role to any principal.


REJECT_WITH_ERROR

static final RoleChecker REJECT_WITH_ERROR
Deprecated. 
An RoleChecker that throws an WebApplicationExeption with status 500 (Internal Server Error) for every call on it.

Method Detail

isInRole

boolean isInRole(Principal principal,
                 String role)
                 throws javax.ws.rs.WebApplicationException
Deprecated. 
Checks, if the user is in the given role, or false if not.
This method is used by the SecurityContext.

Parameters:
principal - The principal to check.
role - the role.
Returns:
true, if the user is in the role, false otherwise.
Throws:
javax.ws.rs.WebApplicationException - The developer may handle exceptions by throw a WebApplicationException.
See Also:
SecurityContext.isUserInRole(String)


Copyright © 2005-2011 Noelios Technologies.