Added tests for permissions