|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@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
.
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 |
---|
static final RoleChecker ALLOW_ALL
static final RoleChecker FORBID_ALL
static final RoleChecker REJECT_WITH_ERROR
RoleChecker
that throws an WebApplicationExeption with status
500 (Internal Server Error) for every call on it.
Method Detail |
---|
boolean isInRole(Principal principal, String role) throws javax.ws.rs.WebApplicationException
SecurityContext
.
principal
- The principal to check.role
- the role.
javax.ws.rs.WebApplicationException
- The developer may handle exceptions by throw a
WebApplicationException
.SecurityContext.isUserInRole(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |