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 void
forwardToErrorPage
(org.craftercms.commons.http.RequestContext context) protected String
void
handle
(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 void
saveException
(org.craftercms.commons.http.RequestContext context, AccessDeniedException e) protected void
sendError
(AccessDeniedException e, org.craftercms.commons.http.RequestContext requestContext) void
setErrorPageUrl
(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:
handle
in interfaceAccessDeniedHandler
- Parameters:
context
- the request contexte
- the exception with the reason of the access deny- Throws:
SecurityProviderException
IOException
-
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:
SecurityProviderException
IOException
-
sendError
protected void sendError(AccessDeniedException e, org.craftercms.commons.http.RequestContext requestContext) throws IOException - Throws:
IOException
-