Improved access checks for swap_roles.php.