if your getting that error, you shouldn't be able to even do a search on someone as it uses the exact same code that is in searching, banning and viewing a user's details.
PHP Code:
if (!$perms[ismoderator] and !$ismod=$DB_site->query_first("SELECT * FROM moderator WHERE userid=$bbuserinfo[userid]")) {
echo "<p>You do not have permission to do this!</p>";
exit;
}