Feature/permissions cache tests for #1792

Tests for #1792