fix: [attributes:addTag] Pass the event to check ACL

pull/7242/head
mokaddem 2021-03-24 10:21:05 +01:00
parent aa2fe120f6
commit bbaffea65c
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 4 deletions

View File

@ -2714,15 +2714,15 @@ class AttributesController extends AppController
} else {
$attribute = $attributes[0];
}
if (!$this->__canModifyTag($attribute, $local)) {
$fails++;
continue;
}
$eventId = $attribute['Attribute']['event_id'];
$event = $this->Attribute->Event->find('first', array(
'conditions' => array('Event.id' => $eventId),
'recursive' => -1
));
if (!$this->__canModifyTag($event, $local)) {
$fails++;
continue;
}
if (!$this->_isRest()) {
$this->Attribute->Event->insertLock($this->Auth->user(), $eventId);
}