Write tests for permissions