MODE-2042: Optimized permissions checks. Added Testcase
MODE-2045: Fix for failed tests
MODE-2045: Fix for failed tests