public function addAccessRule($publicKey, array $accessRule)
{
try {
$result = $this->getAclCollection()->updateOne(['publicKey' => $publicKey], ['$push' => ['acl' => array_merge(['id' => $id = new MongoId()], $accessRule)]]);
return (string) $id;
} catch (MongoException $e) {
throw new DatabaseException('Could not update rule in database', 500, $e);
}
}