aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/note_fragment.php
diff options
context:
space:
mode:
authorwinter2025-05-03 15:54:49 +0100
committerwinter2025-05-03 15:54:49 +0100
commit0310ab4e341365071d62e5449b31614022034b60 (patch)
tree00996abf3533664de8f93773b81bf89df00aa74a /routes/note_fragment.php
parent8548bb523e79ee59f2b762c5063c0f00bca603a0 (diff)
run policies on editing notes
Diffstat (limited to 'routes/note_fragment.php')
-rw-r--r--routes/note_fragment.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/routes/note_fragment.php b/routes/note_fragment.php
index ff9559c..76ef4b7 100644
--- a/routes/note_fragment.php
+++ b/routes/note_fragment.php
@@ -146,6 +146,9 @@ Router::getInstance()->mount('/fragment/note/:id/edit', function (array $args) {
'text/html' => CommonMark::getInstance()->renderToHtml($content)
];
$note->modified = new DateTimeImmutable();
+ if (!PolicyManager::getInstance()->check($note)) {
+ throw new PolicyRejected();
+ }
$note->save();
$note->publish();