improved unit tests for the database permission table