From 446620fad63a01da152b9aa18dfa0de9ae4dc5a3 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 18 Dec 2023 11:53:32 +0100 Subject: [PATCH] chg: [event:publish] Reverse condition for readability and consistency with _add --- app/Model/Event.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Model/Event.php b/app/Model/Event.php index 21b34b5e1..e726e9a55 100755 --- a/app/Model/Event.php +++ b/app/Model/Event.php @@ -4083,8 +4083,8 @@ class Event extends AppModel return array('error' => 'Event could not be saved: Could not find the local event.'); } if ( - (!empty($data['Event']['published']) && !$user['Role']['perm_publish']) || - (Configure::read('MISP.block_publishing_for_same_creator', false) && $user['id'] == $existingEvent['Event']['user_id'] && !$user['Role']['perm_sync']) + (Configure::read('MISP.block_publishing_for_same_creator', false) && !$user['Role']['perm_sync'] && $user['id'] == $existingEvent['Event']['user_id']) || + (!empty($data['Event']['published']) && !$user['Role']['perm_publish']) ) { $data['Event']['published'] = 0; }