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 Bug Fix
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.3
    • Component/s: Development
    • Labels:
      None
    • Similar issues:
      KULRICE-10251Maintain KRMS Agenda permission has confusing and unused permission detail
      KULRICE-11604Issue with wildcarded namespaces in KIM
      KULRICE-4765Contribution: Namespace and String wildcard permission type
      KULRICE-4082Kim Permission document isn't able to edit permissions with KimType of 10 because it can't find the ParameterDetailType matching the namespace and componentName.
      KULRICE-8802Permission details are not saved when new permission goes final
      KULRICE-12471Need to add support in code to use the KR-KRAD namespace permissions instead of the KNS namespace permissions
      KULRICE-4566Permission details can't be modified/created through KIM Permission screen
      KULRICE-6342Permission Document Error offers no help for Permission Details errors
      KULRICE-2042Role qualifications are not editable when editing an existing Principal record
      KULRICE-8857Permission doc says the max length of the Permission Name is 40 characters but KFS has existing values that exceed that
    • 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)

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          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
          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
          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
          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:
              Chad Hagstrom
              Reporter:
              Jerry Neal (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel