Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-12372

Permission Links do not work from Document Configuration screen

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Environment:
      Identified in Env1
    • Rice Module:
      KNS
    • Application Requirement:
      Rice
    • Sprint:
      2.4.0-rc1 Sprint 5, 2.4.0-rc1 Sprint 6, 2.4.0-rc1 Sprint 7
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      To reproduce:
      Go to RICE Sample App (reproduced on env1)
      Update a person permissions.
      Find document in doc search
      Click to expand route log
      Click on person link in route log (type: Person)
      Click on any of the inherited permission links

      java.lang.IllegalArgumentException: class 'org.kuali.rice.kim.impl.permission.PermissionBo' is not a descendent of BusinessObject
      	at org.kuali.rice.kns.service.impl.BusinessObjectDictionaryServiceImpl.validateBusinessObjectClass(BusinessObjectDictionaryServiceImpl.java:795)
      	at org.kuali.rice.kns.service.impl.BusinessObjectDictionaryServiceImpl.getBusinessObjectEntry(BusinessObjectDictionaryServiceImpl.java:629)
      	at org.kuali.rice.kns.service.impl.BusinessObjectDictionaryServiceImpl.getInquiryDefinition(BusinessObjectDictionaryServiceImpl.java:735)
      	at org.kuali.rice.kns.service.impl.BusinessObjectDictionaryServiceImpl.getInquirySections(BusinessObjectDictionaryServiceImpl.java:417)
      	at org.kuali.rice.kns.inquiry.KualiInquirableImpl.getSections(KualiInquirableImpl.java:165)
      	at org.kuali.rice.kns.web.struts.action.KualiInquiryAction.populateSections(KualiInquiryAction.java:417)
      	at org.kuali.rice.kns.web.struts.action.KualiInquiryAction.continueWithInquiry(KualiInquiryAction.java:259)
      	at org.kuali.rice.kns.web.struts.action.KualiInquiryAction.start(KualiInquiryAction.java:140)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
      	at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:173)
      	at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:131)
      	at org.kuali.rice.kns.web.struts.action.KualiInquiryAction.execute(KualiInquiryAction.java:117)
      	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:506)
      	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
      	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:502)
      	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processFormActionAndForward(KualiRequestProcessor.java:231)
      	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.strutsProcess(KualiRequestProcessor.java:218)
      	at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:97)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
      	at org.kuali.rice.kns.web.struts.action.KualiActionServlet.process(KualiActionServlet.java:202)
      	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kuali.rice.krad.web.filter.CharsetFilter.doFilter(CharsetFilter.java:58)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:78)
      	at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:62)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kuali.rice.krad.web.filter.UserLoginFilter.doFilter(UserLoginFilter.java:89)
      	at org.kuali.rice.krad.web.filter.UserLoginFilter.doFilter(UserLoginFilter.java:77)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kuali.rice.krad.web.filter.BootstrapFilterChain.doFilter(BootstrapFilter.java:327)
      	at org.kuali.rice.krad.web.filter.DummyLoginFilter.doFilter(DummyLoginFilter.java:82)
      	at org.kuali.rice.krad.web.filter.DummyLoginFilter.doFilter(DummyLoginFilter.java:62)
      	at org.kuali.rice.krad.web.filter.BootstrapFilterChain.doFilter(BootstrapFilter.java:320)
      	at org.kuali.rice.krad.web.filter.BootstrapFilter.doFilter(BootstrapFilter.java:199)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kuali.rice.core.web.Log4JContextClearingFilter.doFilterInternal(Log4JContextClearingFilter.java:37)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:68)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.springframework.web.filter.AbstractRequestLoggingFilter.doFilterInternal(AbstractRequestLoggingFilter.java:213)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
      	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      

        Attachments

          Issue Links

            Activity

            Hide
            jruch Jeff Ruch added a comment -

            Discovered during CDT.

            Show
            jruch Jeff Ruch added a comment - Discovered during CDT.
            Hide
            shahess Shannon Hess added a comment - - edited

            For testing purposes, Link to Document Configuration for IdentityManagementPersonDocument: http://env1.rice.kuali.org/kew/DocumentConfigurationView.do?methodToCall=start&documentTypeName=IdentityManagementPersonDocument (Any link to view a permission will cause the error)
            .
            .
            The error is due to the line of code below in DocumentConfigurationViewPermissionList.jsp that uses a inquiry boClassName of org.kuali.rice.kim.impl.permission.PermissionBo. PermissionBo used to extend PersistableBusinessObjectBase but now it extends DataObjectBase. According to https://wiki.kuali.org/display/KULRICE/Approach+to+Internal+Conversion+of+Kuali+Rice+modules+from+OJB+to+JPA , "objects which extend PersistableBusinessObjectBase should continue to do so" – but I think reverting changes done for KULRICE-9543 at this point would impact a lot of code.

            Line in DocumentConfigurationViewPermissionList.jsp:

             <kul:inquiry boClassName="org.kuali.rice.kim.impl.permission.PermissionBo"
            

            This CAN be changed to the following to prevent the error "class 'org.kuali.rice.kim.impl.permission.PermissionBo' is not a descendent of BusinessObject". This is the same class that is used when a permission inquiry is done from a permission lookup.

             <kul:inquiry boClassName="org.kuali.rice.kim.impl.permission.UberPermissionBo"
            

            However, both the permission inquiry from the permission lookup and the permission inquiry from the Document Configuration screen then throw a similar error for the class org.kuali.rice.kim.impl.common.attribute.KimAttributeBo, which also extends DataObjectBase (but used to extend PersistableBusinessObjectBase). The UberPermissionBo inquiry is also slightly different from the inquiry that used to be presented by PermissionBo (Screenshots attached)

            So to avoid the error and present the user with the same permission inquiry screen as before 2.4, I left the code in DocumentConfigurationViewPermissionList.jsp alone but enhanced the class check in BusinessObjectDictionaryServiceImpl.validateBusinessObjectClass :

            /**
             * @param businessObjectClass
             * @throws IllegalArgumentException
             *             if the given Class is null or is not a BusinessObject or DataObjectBase class
             */
            private void validateBusinessObjectClass(Class businessObjectClass) {
                if (businessObjectClass == null) {
              	throw new IllegalArgumentException("invalid (null) dataObjectClass");
                }
                if (!BusinessObject.class.isAssignableFrom(businessObjectClass)) {
                    if (!DataObjectBase.class.isAssignableFrom(businessObjectClass)) {
                        throw new IllegalArgumentException("class '" + businessObjectClass.getName()
            					+ "' is not a descendent of BusinessObject or DataObjectBase");
                    } else {
                        LOG.warn(businessObjectClass + " is a descendent of DataObjectBase.");
                    }
                }
            }
            

            So my Question - Is this work around OK or should we look at changing some of these KIM classes back to extend PersistableBusinessObjectBase?

            Show
            shahess Shannon Hess added a comment - - edited For testing purposes, Link to Document Configuration for IdentityManagementPersonDocument: http://env1.rice.kuali.org/kew/DocumentConfigurationView.do?methodToCall=start&documentTypeName=IdentityManagementPersonDocument (Any link to view a permission will cause the error) . . The error is due to the line of code below in DocumentConfigurationViewPermissionList.jsp that uses a inquiry boClassName of org.kuali.rice.kim.impl.permission.PermissionBo. PermissionBo used to extend PersistableBusinessObjectBase but now it extends DataObjectBase. According to https://wiki.kuali.org/display/KULRICE/Approach+to+Internal+Conversion+of+Kuali+Rice+modules+from+OJB+to+JPA , "objects which extend PersistableBusinessObjectBase should continue to do so" – but I think reverting changes done for KULRICE-9543 at this point would impact a lot of code. Line in DocumentConfigurationViewPermissionList.jsp: <kul:inquiry boClassName= "org.kuali.rice.kim.impl.permission.PermissionBo" This CAN be changed to the following to prevent the error "class 'org.kuali.rice.kim.impl.permission.PermissionBo' is not a descendent of BusinessObject". This is the same class that is used when a permission inquiry is done from a permission lookup. <kul:inquiry boClassName= "org.kuali.rice.kim.impl.permission.UberPermissionBo" However, both the permission inquiry from the permission lookup and the permission inquiry from the Document Configuration screen then throw a similar error for the class org.kuali.rice.kim.impl.common.attribute.KimAttributeBo, which also extends DataObjectBase (but used to extend PersistableBusinessObjectBase). The UberPermissionBo inquiry is also slightly different from the inquiry that used to be presented by PermissionBo (Screenshots attached) So to avoid the error and present the user with the same permission inquiry screen as before 2.4, I left the code in DocumentConfigurationViewPermissionList.jsp alone but enhanced the class check in BusinessObjectDictionaryServiceImpl.validateBusinessObjectClass : /** * @param businessObjectClass * @ throws IllegalArgumentException * if the given Class is null or is not a BusinessObject or DataObjectBase class */ private void validateBusinessObjectClass( Class businessObjectClass) { if (businessObjectClass == null ) { throw new IllegalArgumentException( "invalid ( null ) dataObjectClass" ); } if (!BusinessObject.class.isAssignableFrom(businessObjectClass)) { if (!DataObjectBase.class.isAssignableFrom(businessObjectClass)) { throw new IllegalArgumentException( "class '" + businessObjectClass.getName() + "' is not a descendent of BusinessObject or DataObjectBase" ); } else { LOG.warn(businessObjectClass + " is a descendent of DataObjectBase." ); } } } So my Question - Is this work around OK or should we look at changing some of these KIM classes back to extend PersistableBusinessObjectBase?
            Hide
            shahess Shannon Hess added a comment -

            Attaching Screenshots of the two different inquiry screens

            Show
            shahess Shannon Hess added a comment - Attaching Screenshots of the two different inquiry screens
            Hide
            shahess Shannon Hess added a comment - - edited

            Just a note - I believe one of the other issues (KULRICE-12404) I discovered while working on this is also due to KimAttributeDataBo no longer extending PersistableBusinessObjectBase

            Show
            shahess Shannon Hess added a comment - - edited Just a note - I believe one of the other issues ( KULRICE-12404 ) I discovered while working on this is also due to KimAttributeDataBo no longer extending PersistableBusinessObjectBase
            Hide
            shahess Shannon Hess added a comment -

            Response from Claus regarding changing it back to the PersistableBusinessObjectBase (Decided that was the best option):

            [4/3/2014 10:08:56 AM] Claus Niesen: Still pondering about that. Mainly if your BusinessObjectDictionaryServiceImpl.validateBusinessObjectClass will truly be a universal fix.

            With KULRICE-11731 changing it to PersistableBusinessObjectBase was choosen.
            [4/3/2014 10:13:39 AM] Claus Niesen: KULRICE-12404 isn't fixed by that either. A ResponsibilityAttributeBo cannot be cast to BusinessObject error is thrown. There changing it to the PersistableBusinessObjectBase gets you further. Ultimately hitting the "Attempted to fetch a relationship using a foreign key attribute when one does not exist: responsibilityBo" error.
            [4/3/2014 10:36:19 AM] Claus Niesen: Right now I lean torwards just changing it back to the PersistableBusinessObjectBase.

            Show
            shahess Shannon Hess added a comment - Response from Claus regarding changing it back to the PersistableBusinessObjectBase (Decided that was the best option): [4/3/2014 10:08:56 AM] Claus Niesen: Still pondering about that. Mainly if your BusinessObjectDictionaryServiceImpl.validateBusinessObjectClass will truly be a universal fix. With KULRICE-11731 changing it to PersistableBusinessObjectBase was choosen. [4/3/2014 10:13:39 AM] Claus Niesen: KULRICE-12404 isn't fixed by that either. A ResponsibilityAttributeBo cannot be cast to BusinessObject error is thrown. There changing it to the PersistableBusinessObjectBase gets you further. Ultimately hitting the "Attempted to fetch a relationship using a foreign key attribute when one does not exist: responsibilityBo" error. [4/3/2014 10:36:19 AM] Claus Niesen: Right now I lean torwards just changing it back to the PersistableBusinessObjectBase.

              People

              • Assignee:
                shahess Shannon Hess
                Reporter:
                jruch Jeff Ruch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h