Add tests for permissions cache
Removed unused imports
Merge pull request #1810 from yakky/feature/permissions_cache_tests

Add tests for permissions cache