The sfGuardPlugin API seems not to be complete.
addGroupByName($name) and add PermissionByName?($name) methods don't have a connection parameter, for exemple to start a transaction before calling this methods (which call a save() method and so interract with database).
So a quick fix for all methods calling save() shoulde be :
public function addPermissionByName($name, $con = null)
{
$permission = sfGuardPermissionPeer::retrieveByName($name);
if (!$permission)
{
throw new Exception(sprintf('The permission "%s" does not exist.', $name));
}
$up = new sfGuardUserPermission();
$up->setUserId($this->getId());
$up->setPermissionId($permission->getId());
$up->save($con);
}