backported permissions cache from 7.1 for speed
Merge branch 'permission_cache' into v7.0.1

* permission_cache:
  backported permissions cache from 7.1 for speed