improved searching options, refactors permissionform.search