Class AccessDeniedHandlerImpl
- java.lang.Object
-
- org.craftercms.security.authorization.impl.AccessDeniedHandlerImpl
-
- All Implemented Interfaces:
AccessDeniedHandler
public class AccessDeniedHandlerImpl extends Object implements AccessDeniedHandler
Default implementation ofAccessDeniedHandler
, 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 Modifier and Type Field Description protected String
errorPageUrl
-
Constructor Summary
Constructors Constructor Description AccessDeniedHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
forwardToErrorPage(org.craftercms.commons.http.RequestContext context)
protected String
getErrorPageUrl()
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 Detail
-
errorPageUrl
protected String errorPageUrl
-
-
Method Detail
-
setErrorPageUrl
public void setErrorPageUrl(String errorPageUrl)
Sets the error page URL to forward to.
-
getErrorPageUrl
protected String 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
-
-