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

Cannot edit permission record with a namespace detail value that has wildcard

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.3
    • Component/s: Development
    • Labels:
      None
    • Rice Module:
      KIM
    • Application Requirement:
      KFS

      Description

      If you edit any permission that has namespace code detail and specify a wildcard the maintenance document gives the following error and will not allow you to submit:

      error Errors found in this Section:
      Attribute namespaceCode is not valid: error.existence:Namespace Code;

      (also see screenshot)

      Many of our permissions like this need wildcard support, in fact many that come out of the box have wildcard values (like perms in KR-SYS)

        Attachments

          Issue Links

            Activity

            Hide
            jjhanso Jeremy Hanson added a comment -

            log output:

            2010-05-18 16:43:21,437 [btpool0-6] u:admin/d: FATAL org.kuali.rice.core.database.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will cause a rollback at the end of the transaction.
            org.kuali.rice.kns.exception.ValidationException: business rule evaluation failed
            at org.kuali.rice.kns.document.MaintenanceDocumentBase.validateBusinessRules(MaintenanceDocumentBase.java:735)
            at org.kuali.rice.kns.service.impl.DocumentServiceImpl.validateAndPersistDocument(DocumentServiceImpl.java:679)
            at org.kuali.rice.kns.service.impl.DocumentServiceImpl.routeDocument(DocumentServiceImpl.java:183)
            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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203)
            at $Proxy50.routeDocument(Unknown Source)
            at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.route(KualiDocumentActionBase.java:700)
            at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.route(KualiMaintenanceDocumentAction.java:442)
            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:270)
            at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:171)
            at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:122)
            at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.execute(KualiDocumentActionBase.java:154)
            at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.execute(KualiMaintenanceDocumentAction.java:97)
            at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:503)
            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127)
            at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:499)
            at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
            at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:101)
            at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
            at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
            at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:92)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
            at org.kuali.rice.kew.web.BootstrapFilterChain.doFilter(BootstrapFilter.java:305)
            at org.kuali.rice.kew.web.DummyLoginFilter.doFilter(DummyLoginFilter.java:88)
            at org.kuali.rice.kew.web.BootstrapFilterChain.doFilter(BootstrapFilter.java:298)
            at org.kuali.rice.kew.web.BootstrapFilter.doFilter(BootstrapFilter.java:166)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
            at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
            at org.kuali.rice.kns.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:66)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
            at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
            at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
            at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
            at org.mortbay.jetty.Server.handle(Server.java:285)
            at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
            at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
            at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

            Show
            jjhanso Jeremy Hanson added a comment - log output: 2010-05-18 16:43:21,437 [btpool0-6] u:admin/d: FATAL org.kuali.rice.core.database.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will cause a rollback at the end of the transaction. org.kuali.rice.kns.exception.ValidationException: business rule evaluation failed at org.kuali.rice.kns.document.MaintenanceDocumentBase.validateBusinessRules(MaintenanceDocumentBase.java:735) at org.kuali.rice.kns.service.impl.DocumentServiceImpl.validateAndPersistDocument(DocumentServiceImpl.java:679) at org.kuali.rice.kns.service.impl.DocumentServiceImpl.routeDocument(DocumentServiceImpl.java:183) 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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:139) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:203) at $Proxy50.routeDocument(Unknown Source) at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.route(KualiDocumentActionBase.java:700) at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.route(KualiMaintenanceDocumentAction.java:442) 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:270) at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:171) at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:122) at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.execute(KualiDocumentActionBase.java:154) at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.execute(KualiMaintenanceDocumentAction.java:97) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:503) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:127) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:499) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:101) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074) at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:92) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.kuali.rice.kew.web.BootstrapFilterChain.doFilter(BootstrapFilter.java:305) at org.kuali.rice.kew.web.DummyLoginFilter.doFilter(DummyLoginFilter.java:88) at org.kuali.rice.kew.web.BootstrapFilterChain.doFilter(BootstrapFilter.java:298) at org.kuali.rice.kew.web.BootstrapFilter.doFilter(BootstrapFilter.java:166) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.kuali.rice.kns.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:66) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:285) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
            Hide
            chagstrom Chad Hagstrom added a comment -

            The problem seems to be that during validation, the KimTypeService (KimPermissionTypeService) validates FK references using validateReferenceExistsAndIsActive() on the DictionaryValidationServiceImpl, which in turn checks to ensure that the FK fields refer to existing/active objects. in the case of KNS Namespaces, that method will check to see if the namespace code "KR*" refers to one existing Namespace, without treating it as a wildcard-allowed expression (since that could result in multiple objects being returned).

            I am currently looking into possible workarounds.

            Show
            chagstrom Chad Hagstrom added a comment - The problem seems to be that during validation, the KimTypeService (KimPermissionTypeService) validates FK references using validateReferenceExistsAndIsActive() on the DictionaryValidationServiceImpl, which in turn checks to ensure that the FK fields refer to existing/active objects. in the case of KNS Namespaces, that method will check to see if the namespace code "KR*" refers to one existing Namespace, without treating it as a wildcard-allowed expression (since that could result in multiple objects being returned). I am currently looking into possible workarounds.
            Hide
            chagstrom Chad Hagstrom added a comment - - edited

            This has been fixed by having NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImpl override the validateReferencesExistAndActive() method on the KimTypeServiceBase superclass so that it will use the lookup service to determine if "namespaceCode" permission details are valid. If at least one Namespace was found by the lookup (more than one if the detail's value contains wildcards), then exists-and-active checks will be performed on each retrieved Namespace; otherwise, users will receive the error message that was happening before. All non-namespaceCode details are validated the same way that they were before, and no "namespaceCode" validation will occur if the permission does not define a detail for it.

            Show
            chagstrom Chad Hagstrom added a comment - - edited This has been fixed by having NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImpl override the validateReferencesExistAndActive() method on the KimTypeServiceBase superclass so that it will use the lookup service to determine if "namespaceCode" permission details are valid. If at least one Namespace was found by the lookup (more than one if the detail's value contains wildcards), then exists-and-active checks will be performed on each retrieved Namespace; otherwise, users will receive the error message that was happening before. All non-namespaceCode details are validated the same way that they were before, and no "namespaceCode" validation will occur if the permission does not define a detail for it.
            Hide
            chagstrom Chad Hagstrom added a comment -

            Also, one thing to note is that this fix currently just works for permissions whose KIM types on their permission templates refer to KIM type services that are instances of NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImpl or one of its subclasses. If this fix is needed for even more KIM type services, then the fix for this issue will need to be copied or relocated accordingly.

            Show
            chagstrom Chad Hagstrom added a comment - Also, one thing to note is that this fix currently just works for permissions whose KIM types on their permission templates refer to KIM type services that are instances of NamespaceWildcardAllowedAndOrStringExactMatchPermissionTypeServiceImpl or one of its subclasses. If this fix is needed for even more KIM type services, then the fix for this issue will need to be copied or relocated accordingly.

              People

              • Assignee:
                chagstrom Chad Hagstrom
                Reporter:
                jkneal Jerry Neal (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: