Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-802

Privilege View Tribes required to view users and add users

    XMLWordPrintable

    Details

      Description

      The privilege "View Tribes" is a required privilege when trying to view users or add new users. The "View Tribes" privilege is not created by default; per the web demo. When trying to view uses, the list of users is blank (no users) when the "View Tribes" privilege doesn't exist. When trying to add a user, after entering their name, birth date (or age), and gender, it yields the following error if the "View Tribes" privilege doesn't exist.

      An Internal Error has Occurred
      org.hibernate.ObjectNotFoundException
      
      No row with the given identifier exists: [Tribes|org.openmrs.Privilege#View]
      
      Consult the help document.
      Contact your friendly neighborhood administrator if it cannot be resolved.
      
      Hide stack trace
      org.hibernate.impl.SessionFactoryImpl$1.handleEntityNotFound(SessionFactoryImpl.java:377)
      org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:145)
      org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:195)
      org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:103)
      org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
      org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:846)
      org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:557)
      org.hibernate.type.EntityType.resolve(EntityType.java:379)
      org.hibernate.type.EntityType.nullSafeGet(EntityType.java:204)
      org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:703)
      org.hibernate.collection.PersistentSet.readFrom(PersistentSet.java:318)
      org.hibernate.loader.Loader.readCollectionElement(Loader.java:1008)
      org.hibernate.loader.Loader.readCollectionElements(Loader.java:646)
      org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:591)
      org.hibernate.loader.Loader.doQuery(Loader.java:701)
      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
      org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
      org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
      org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
      org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
      org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
      org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:454)
      org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:797)
      org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:241)
      org.hibernate.loader.Loader.doList(Loader.java:2220)
      org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
      org.hibernate.loader.Loader.list(Loader.java:2099)
      org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
      org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
      org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
      org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
      org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
      org.openmrs.api.db.hibernate.HibernateUserDAO.getAllRoles(HibernateUserDAO.java:310)
      org.openmrs.api.impl.UserServiceImpl.getAllRoles(UserServiceImpl.java:258)
      sun.reflect.GeneratedMethodAccessor242.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      $Proxy14.getAllRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor242.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:107)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      $Proxy15.getAllRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor242.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      $Proxy15.getAllRoles(Unknown Source)
      sun.reflect.GeneratedMethodAccessor242.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:597)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
      $Proxy57.getAllRoles(Unknown Source)
      org.openmrs.web.controller.user.UserFormController.referenceData(UserFormController.java:315)
      org.springframework.web.servlet.mvc.AbstractFormController.showForm(AbstractFormController.java:574)
      org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:198)
      org.springframework.web.servlet.mvc.SimpleFormController.showForm(SimpleFormController.java:175)
      org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:338)
      org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:278)
      org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
      org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.openmrs.web.filter.OpenmrsFilter.doFilter(OpenmrsFilter.java:124)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.openmrs.web.filter.initialization.InitializationFilter.doFilter(InitializationFilter.java:116)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
      org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
      org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
      org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
      org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
      org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
      org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
      java.lang.Thread.run(Thread.java:619)
      
      OpenMRS Version: 1.5.0 dev Build 7268
      

      If the "View Tribes" privilege exists, none of the above occur, but now that tribe has been moved to a module, the "View Tribes" privilege should not be required by default.

      For more background, see the ticket for tribe to person attribute (and module)...
      http://dev.openmrs.org/ticket/652

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              upul Upul Godage
              Reporter:
              arbaughj James Arbaugh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: