Permission tests
Permission#elements -> #records
Refactoring DB tasks