Added hasAccessRule check to index so that User can be dependencyinjected.