|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.ServletRequestWrapper javax.servlet.http.HttpServletRequestWrapper org.apache.wiki.ui.WikiRequestWrapper
public class WikiRequestWrapper
Servlet request wrapper that encapsulates an incoming HTTP request and overrides its security methods so that the request returns JSPWiki-specific values.
Field Summary |
---|
Fields inherited from interface javax.servlet.http.HttpServletRequest |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
WikiRequestWrapper(WikiEngine engine,
javax.servlet.http.HttpServletRequest request)
Constructs a new wrapped request. |
Method Summary | |
---|---|
String |
getRemoteUser()
Returns the remote user for the HTTP request, taking into account both container and JSPWiki custom authentication status. |
Principal |
getUserPrincipal()
Returns the user principal for the HTTP request, taking into account both container and JSPWiki custom authentication status. |
boolean |
isUserInRole(String role)
Determines whether the current user possesses a supplied role, taking into account both container and JSPWIki custom authentication status. |
Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
---|
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid |
Methods inherited from class javax.servlet.ServletRequestWrapper |
---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding, setRequest |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.ServletRequest |
---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding |
Constructor Detail |
---|
public WikiRequestWrapper(WikiEngine engine, javax.servlet.http.HttpServletRequest request)
engine
- the wiki enginerequest
- the request to wrapMethod Detail |
---|
public String getRemoteUser()
WikiSession.isAuthenticated()
returns true
,
this method returns the name of the principal returned by
WikiSession.getLoginPrincipal()
.
getRemoteUser
in interface javax.servlet.http.HttpServletRequest
getRemoteUser
in class javax.servlet.http.HttpServletRequestWrapper
public Principal getUserPrincipal()
WikiSession.isAuthenticated()
returns
true
, this method returns the value of
WikiSession.getLoginPrincipal()
.
getUserPrincipal
in interface javax.servlet.http.HttpServletRequest
getUserPrincipal
in class javax.servlet.http.HttpServletRequestWrapper
public boolean isUserInRole(String role)
true
. If not, this method
iterates through the built-in Role objects (e.g., ANONYMOUS,
ASSERTED, AUTHENTICATED) returned by WikiSession.getRoles()
and
checks to see if any of these principals' names match the supplied role.
isUserInRole
in interface javax.servlet.http.HttpServletRequest
isUserInRole
in class javax.servlet.http.HttpServletRequestWrapper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |