Fix for error with removing access right
Tests for removing access right