Issue #2501117 by catch, olli, Wim Leers, dawehner: Add static caching for PermissionsHashGenerator::generate()