Class AccessDeniedHandlerImpl
java.lang.Object
org.craftercms.security.authorization.impl.AccessDeniedHandlerImpl
- All Implemented Interfaces:
AccessDeniedHandler
Default implementation of
AccessDeniedHandler, which forwards to the error page URL, so that the original
URL is preserved in the browser. If not error URL is specified, a 403 FORBIDDEN error is sent.- Author:
- Alfonso Vásquez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidforwardToErrorPage(org.craftercms.commons.http.RequestContext context) protected Stringvoidhandle(org.craftercms.commons.http.RequestContext context, AccessDeniedException e) Forwards to the error page, but if not error page was specified, a 403 error is sent.protected voidsaveException(org.craftercms.commons.http.RequestContext context, AccessDeniedException e) protected voidsendError(AccessDeniedException e, org.craftercms.commons.http.RequestContext requestContext) voidsetErrorPageUrl(String errorPageUrl) Sets the error page URL to forward to.
-
Field Details
-
errorPageUrl
-
-
Constructor Details
-
AccessDeniedHandlerImpl
public AccessDeniedHandlerImpl()
-
-
Method Details
-
setErrorPageUrl
Sets the error page URL to forward to. -
getErrorPageUrl
-
handle
public void handle(org.craftercms.commons.http.RequestContext context, AccessDeniedException e) throws SecurityProviderException, IOException Forwards to the error page, but if not error page was specified, a 403 error is sent.- Specified by:
handlein interfaceAccessDeniedHandler- Parameters:
context- the request contexte- the exception with the reason of the access deny- Throws:
SecurityProviderExceptionIOException
-
saveException
protected void saveException(org.craftercms.commons.http.RequestContext context, AccessDeniedException e) -
forwardToErrorPage
protected void forwardToErrorPage(org.craftercms.commons.http.RequestContext context) throws SecurityProviderException, IOException - Throws:
SecurityProviderExceptionIOException
-
sendError
protected void sendError(AccessDeniedException e, org.craftercms.commons.http.RequestContext requestContext) throws IOException - Throws:
IOException
-