Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-9146

SuperUserAction tab does not load when using custom DocumentTypeAuthorizer implementation in embedded mode

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.4, 2.2.2
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-2729The "Future Action Requests" tab on the Route Log does not work properly with a client application using "embedded" mode
      KULRICE-7169Rice object lookup quickfinders not working when related module is in EMBEDDED mode
      KULRICE-7180enDocumentSearchService not available in EMBEDDED mode
      KULRICE-8687Immediate Action Emails don't work on client applications using KEW in embedded mode
      KULRICE-2059When exporting Document Type using custom nodes, exporter attempts to load the node's Java class
      KULRICE-6756DocumentSearchCustomizationServiceImpl does not load customizers properly
      KULRICE-13279Ajax Field Query Custom Method and Service: Tabbing out of the field does not load the data for the travel account
      KULRICE-6917LocationModuleConfiguration is not available for embedded clients
      KULRICE-10335Startup issues with Rice 2.4 in embedded mode
      KULRICE-7015enRuleAttributeService must be defined locally in KEW EMBEDDED mode
    • Rice Module:
      KIM
    • Application Requirement:
      KC
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      In order to reproduce, in an embedded client app, create a custom authorizer for roleQualifiers and add to the documentType. Add the super user panel to the document and open it (Or start up KC in embedded mode. Navigate to Researcher tab > Create a proposal > fill in required fields

      	
      *  Sponsor Code:000340
          
      *  Proposal Type:New
      	
      *  Project Start Date:01/01/2013
        
      *  Lead Unit:000001
      	
      *  Project End Date:03/31/2013
        
      *  Activity Type: Clnical Trial
      	 	 
      *  Project Title: Test
        
      

      and navigate to the proposal actions tab in the proposal Development document). The super user panel will not load fully and in the error logs you see the following stack trace. I have verified that the custom authorizer class does implement the DocumentTypeAuthorizer.

      2013-03-13 08:01:42,243 [qtp1675553600-66] D: U: WARN  org.apache.cxf.phase.PhaseInterceptorChain :: Application {http://rice.kuali.org/kew/v2_0}documentTypeService#{http://rice.kuali.org/kew/v2_0}canSuperUserApproveSingleActionRequest has thrown exception, unwinding now
      org.apache.cxf.interceptor.Fault: DocumentType Authorizer 'org.kuali.kra.KcAuthorizer' configured for document type 'ProposalDevelopmentDocument does not implement org.kuali.rice.kew.framework.document.security.DocumentTypeAuthorizer
      	at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:162)
      	at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:213)
      	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:128)
      	at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178)
      	at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:64	
      

      This DocumentAuthorizer implementation to build custom role qualifiers works well in all situations except when called from the super user action tab. The problem occurs when the superUserAction.tab calls the DocumentTypeServiceImpl methods canSuperUser*. These methods try to authorize using the following code

      boolean isSuperUser = KEWServiceLocator.getDocumentTypePermissionService().canSuperUserApproveDocument(
                      principalId, documentType, currentNodeInstances, routeStatusCode);
      

      The DocumentTypePermissionServiceAuthorizerImpl tries to get the custom implementation but cannot because the isAssignableFrom(extension.getClass()) of the getDocumentTypeAuthorizer returns false in this particular scenario. I have confirmed that this methods returns the right authorizer correctly in other situations when testing for canSave, canRecall etc. The issue also seems to happen only when the authorizer implementation is on the KC end. I tested this by adding "org.kuali.rice.kew.doctype.service.impl.KimDocumentTypeAuthorizer" to the authorizer element of the document type and that works. Let me know if you want to do a screenshare and debug through it.

        Activity

        Hide
        Gayathri Athreya added a comment - - edited

        Should the custom authorizer be a service that is exposed on the service bus? I did not think so but perhaps that is what is needed? Rice has no problems materializing this class in other instances, it is only when the call is from the DocumentTypeService that this trace is thrown. This should work just like the postprocessor right and those are usually not exposed on the bus?

        Show
        Gayathri Athreya added a comment - - edited Should the custom authorizer be a service that is exposed on the service bus? I did not think so but perhaps that is what is needed? Rice has no problems materializing this class in other instances, it is only when the call is from the DocumentTypeService that this trace is thrown. This should work just like the postprocessor right and those are usually not exposed on the bus?
        Hide
        Peter Giles (Inactive) added a comment -

        I think we're good here. I moved the DocumentTypeService to embedded mode, and the screen worked as expected in KC. Looking in to the calls that end up in the DocumentTypeAuthorizer, I don't think we have any other remoting worries, although I'll wait to get further confirmation on that from Eric. I've committed the change (r37732).

        Show
        Peter Giles (Inactive) added a comment - I think we're good here. I moved the DocumentTypeService to embedded mode, and the screen worked as expected in KC. Looking in to the calls that end up in the DocumentTypeAuthorizer, I don't think we have any other remoting worries, although I'll wait to get further confirmation on that from Eric. I've committed the change (r37732).
        Hide
        Gayathri Athreya added a comment -

        Thanks a lot Peter, I will test it as well.

        Show
        Gayathri Athreya added a comment - Thanks a lot Peter, I will test it as well.
        Hide
        Peter Giles (Inactive) added a comment -

        I'm going to resolve this but if you have any trouble with it then please re-open it.

        Show
        Peter Giles (Inactive) added a comment - I'm going to resolve this but if you have any trouble with it then please re-open it.
        Hide
        Gayathri Athreya added a comment - - edited

        Yes Peter, that's fine. It seems to work now, thanks! I will close this once the associated KC jira is closed.

        Show
        Gayathri Athreya added a comment - - edited Yes Peter, that's fine. It seems to work now, thanks! I will close this once the associated KC jira is closed.
        Hide
        Gayathri Athreya added a comment -

        Working as expected.

        Show
        Gayathri Athreya added a comment - Working as expected.

          People

          • Assignee:
            Peter Giles (Inactive)
            Reporter:
            Gayathri Athreya
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel