From e787048af114d6387f61c800a0339d134106580c Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Sat, 3 Oct 2020 23:37:56 +0100 Subject: [PATCH] Fix Editing Discussion Tags Permission (#95) --- extensions/tags/src/Listener/SaveTagsToDatabase.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/tags/src/Listener/SaveTagsToDatabase.php b/extensions/tags/src/Listener/SaveTagsToDatabase.php index 2d16fb5f8..19e271db9 100755 --- a/extensions/tags/src/Listener/SaveTagsToDatabase.php +++ b/extensions/tags/src/Listener/SaveTagsToDatabase.php @@ -59,6 +59,10 @@ class SaveTagsToDatabase // TODO: clean up, prevent discussion from being created without tags if (isset($event->data['relationships']['tags']['data'])) { + if ($discussion->exists) { + $actor->assertCan('tag', $discussion); + } + $linkage = (array) $event->data['relationships']['tags']['data']; $newTagIds = [];