Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-75316

Visiting as a guest a page with a KB display with a KB article viewable only by site members throws exceptions

    Details

      Description

      Steps to Reproduce

      1. Deploy the KB modules
      2. Add a KB article viewable by Site Members. 
      3. Add 'KB display' in page.
      4. Log out and then refresh page.

      Expected Result

      • No matter the KB article shows or not. There's no exception on console.
        Actual Result
      • An exception is thrown:
        ERROR [http-bio-8088-exec-6][IncludeTag:128] Current URL /web/guest generates exception: An exception occurred processing JSP page /admin/common/view_article.jsp at line 27__24: _25: 	KBArticleLocalServiceUtil.updateViewCount(themeDisplay.getUserId(), kbArticle.getResourcePrimKey(), latestKBArticle.getViewCount() + 1);_26: _27: 	AssetEntryServiceUtil.incrementViewCounter(KBArticle.class.getName(), latestKBArticle.getClassPK());_28: }_29: %>_30: ___Stacktrace: [Sanitized]
        com.liferay.portal.security.auth.PrincipalException$MustHavePermission: User  must have VIEW permission for com.liferay.knowledgebase.model.KBArticle 
        	at com.liferay.portlet.asset.service.permission.AssetEntryPermission.check(AssetEntryPermission.java:59)
        	at com.liferay.portlet.asset.service.impl.AssetEntryServiceImpl.incrementViewCounter(AssetEntryServiceImpl.java:139)
        	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:153)
        	at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:93)
        	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
        	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
        	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
        	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
        	at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:56)
        	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:127)
        	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:173)
        	at com.liferay.portlet.asset.service.AssetEntryServiceUtil.incrementViewCounter(AssetEntryServiceUtil.java:88)
        	at org.apache.jsp.admin.common.view_005farticle_jsp._jspService(view_005farticle_jsp.java:430)
        	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
        	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
        	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sylvia.luan Sylvia Luan
              Reporter:
              daniel.couso Daniel Couso
              Participants of an Issue:
              Recent user:
              Jason Pince
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 35 weeks, 6 days ago

                  Packages

                  Version Package
                  7.0.X
                  7.1.X
                  Master