junit tests for permissions model