public class WikiRequestWrapper extends javax.servlet.http.HttpServletRequestWrapper
Constructor and Description |
---|
WikiRequestWrapper(WikiEngine engine,
javax.servlet.http.HttpServletRequest request)
Constructs a new wrapped request.
|
Modifier and Type | Method and Description |
---|---|
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.
|
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, login, logout, upgrade
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, isWrapperFor, isWrapperFor, removeAttribute, setAttribute, setCharacterEncoding, setRequest, startAsync, startAsync
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
public WikiRequestWrapper(WikiEngine engine, javax.servlet.http.HttpServletRequest request)
engine
- the wiki enginerequest
- the request to wrappublic 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
Copyright © 2001-2019 The Apache Software Foundation. All rights reserved.