Integration test for permission links.
Merge branch '2193-fix-permissions-cache' (no functional changes, only unit tests)