Transmit the user who clears an acknowledgement

This commit is contained in:
Johannes Meyer 2020-05-14 13:58:19 +02:00
parent 08bc671fb7
commit f6edad9336
3 changed files with 4 additions and 1 deletions

View File

@ -107,6 +107,7 @@ class RemoveAcknowledgementCommandForm extends ObjectsCommandForm
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
$removeAck = new RemoveAcknowledgementCommand();
$removeAck->setObject($object);
$removeAck->setAuthor($this->Auth()->getUser()->getUsername());
$this->getTransport($this->request)->send($removeAck);
}
Notification::success(mtp(

View File

@ -8,6 +8,8 @@ namespace Icinga\Module\Monitoring\Command\Object;
*/
class RemoveAcknowledgementCommand extends ObjectCommand
{
use CommandAuthor;
/**
* (non-PHPDoc)
* @see \Icinga\Module\Monitoring\Command\Object\ObjectCommand::$allowedObjects For the property documentation.

View File

@ -257,7 +257,7 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface
public function renderRemoveAcknowledgement(RemoveAcknowledgementCommand $command)
{
$endpoint = 'actions/remove-acknowledgement';
$data = array();
$data = ['author' => $command->getAuthor()];
$this->applyFilter($data, $command->getObject());
return IcingaApiCommand::create($endpoint, $data);
}