Class CatalogVersionInterceptor

  • All Implemented Interfaces:
    org.springframework.web.servlet.AsyncHandlerInterceptor, org.springframework.web.servlet.HandlerInterceptor

    public class CatalogVersionInterceptor
    extends org.springframework.web.servlet.handler.HandlerInterceptorAdapter
    Default interceptor to run before controllers' execution to extract the catalog-id and version-id from the request URI and to set the current session values. Also determines if the current user has the required permission to access the catalog version.
    • Constructor Detail

      • CatalogVersionInterceptor

        public CatalogVersionInterceptor()
    • Method Detail

      • preHandle

        public boolean preHandle​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response,
                                 java.lang.Object handler)
                          throws java.lang.Exception
        Adds the catalog and version to the session. Also determines if the current user has read or write permission to the catalog version for an operation given by the request's HTTP method. In the case that the user does not have permission, we return an error in the HTTP response using the status code 403 - Forbidden.
        Specified by:
        preHandle in interface org.springframework.web.servlet.HandlerInterceptor
        Overrides:
        preHandle in class org.springframework.web.servlet.handler.HandlerInterceptorAdapter
        Throws:
        java.lang.Exception -
      • setCmsAdminSiteService

        public void setCmsAdminSiteService​(CMSAdminSiteService cmsAdminSiteService)
      • setCatalogVersionService

        public void setCatalogVersionService​(CatalogVersionService catalogVersionService)